I just need a single MySQL line query for the following.
Lets say there are 2 simple tables: Class and Books<
Class
Books
Something like this:
select c.classId, sum(b.cost) as TotalCost,sum(c.students) as TotalStudents from books as b, class as c where b.classId = class.Id and c.Id = YourKnowClassId group by c.Id;