select COUNT(1) from(select * from Stu_Studentgroup by CampusID,DeptID,MajorID,Grade) s
参考页面:http://bbs.csdn.net/topics/390758575