I just need a single MySQL line query for the following.
Lets say there are 2 simple tables: Class and Books
Class
ID--Name-----Students
1——KG———–20
2——Grade(3)—25
3——Grade(5)—30
Books
ID--ClassId--Title-------------Cost
1—–1————–Drawing——————5
2—–3————–History——————–25
3—–1————–A-to-Z——————–10
4—–2————–Alphabets—————20
5—–3————–Maths——————–15
6—–2————–English——————-30
Lets say:
What we only know is —–> ID of the Class
What we have to find is —> Book Cost of a class. (Books for Each Students In A Class)
Can I just have a Single Line of Query for it?
Try this:
In Single Line:
With formatting: