题解 | #出现三次以上相同积分的情况#
出现三次以上相同积分的情况
http://www.nowcoder.com/practice/c69ac94335744480aa50646864b7f24d
不记得用having了,搞了个窗口函数,写复杂了,不过能通过
SELECT DISTINCT g.number FROM grade g WHERE EXISTS ( SELECT g1.number FROM ( SELECT id,number,COUNT(*)OVER(PARTITION BY number) AS cnumber FROM grade) AS g1 WHERE g1.id=g.id AND g1.cnumber>=3)