プログラマーと熱狂的なプログラマーのためのサイトに関する質問と回答
with top_locations as ( select Location, count(1) records, row_number() over(order by count(1) desc) rn from users where Location is not null group by Location ) select * from top_locations where rn < 5