我正在我的网站上进行比赛.每场比赛都可以有多个参赛作品 如果只有MAX值的投票有重复,我想检索.
表格如下:
contest_id entry_id votes
1 1 50
1 2 34
1 3 50
2 4 20
2 5 55
3 6 53
Run Code Online (Sandbox Code Playgroud)
我只需要查询就可以告诉我比赛1有一个重复的MAX值而无需其他信息.
我尝试了这个但是没有用:
SELECT MAX(votes) from contest group by contest_id having count(votes) > 1
Run Code Online (Sandbox Code Playgroud)