Convert SQL computer to ROLL UP sql server 2012 since its no longer support compute -
Convert SQL computer to ROLL UP sql server 2012 since its no longer support compute -
i have db this:
for meaning: lop: class sinhvien: student khoa: department monhoc: subject diemthi: mark
i want query list class , number of class belong each department
select khoa.makhoa,tenkhoa,malop,tenlop khoa,lop khoa.makhoa=lop.makhoa order khoa.makhoa compute count(malop) khoa.makhoa
and result
but, sql 2012 no longer back upwards compute, said it's can done roll can't syntax, please help me
update 1: radar's result, more help
you can replace compute
rollup
, grouping by
select khoa.makhoa,tenkhoa,malop,tenlop , count(malop) khoa,lop khoa.makhoa=lop.makhoa grouping khoa.makhoa,tenkhoa,malop,tenlop rollup
sql sql-server sql-server-2012 rollup
Comments
Post a Comment