的输出最大结果我使用的查询:查询来获取来自其他查询
select count(registration.stu_id) as cnt,course.dept_id from registration,course where registration.course_id=course.course_id group by registration.course_id, course.dept_id
从该查询我得到的结果是:
cnt | dept_id
2 | 1
1 | 3
1 | 2
1 | 4
1 | 5
现在我需要找出与结果max cnt
我应该使用什么查询?
限制不支持在MS SQL服务器 –
是SQL Server不支持限制,您可以改为使用顶部关键字。你在mysql中标记了这个问题。 – Krishna