I have db like this:
For meaning:
LOP: class
SINHVIEN: student
KHOA: department
MONHOC: subject
DIEMTHI: mark
I want to do the query to list ALL the CLASS and the number of CLASS belong to each DEPARTMENT
SELECT khoa.makhoa,tenkhoa,malop,tenlop FROM khoa,lop
WHERE khoa.makhoa=lop.makhoa
ORDER BY khoa.makhoa
COMPUTE COUNT(malop) BY khoa.makhoa
and the result look like
But, the SQL 2012 NO LONGER support COMPUTE, they said it's can be done with ROLL UP but I can't do with its syntax, please help me
Update 1:
RADAR's result, with more help