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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -