0
我在下面的代碼中有一個oracle SQL查詢。此代碼可查找每個成員的用戶名以及他們每年投了多少次。我怎樣才能修改它,以便它只顯示投票次數最多的用戶?Oracle SQL查詢 - 僅顯示最大值?
SELECT username, count(username), extract(year from voteDate) as vote_year,
max(count(*)) over (partition by extract(year from voteDate)) as Max_votes
FROM rankingInfo NATURAL JOIN memberinfo
GROUP BY username, extract(year from voteDate);
'+ 1'好'回答:)' –