题目链接:点击打开链接
题目大意:略。
解题思路:注意解决方案(1)使用的 ALL 函数。
AC 代码
-- 解决方案(1) select project_id from project group by project_id having count(*) >=all (select count(*) amount from project group by project_id) -- 解决方案(2) SELECT project_id FROM (SELECT project_id, dense_RANK() OVER(ORDER BY COUNT(*) DESC) CNT FROM Project GROUP BY project_id) RS WHERE CNT = 1