直接上代码~
求每个省份人口数量前三的城市
select province ,city ,population from ( select province ,city ,population ,row_number() over(partition by province order by population desc) rnk from table ) tmp where rnk <= 3 ;

直接上代码~
求每个省份人口数量前三的城市
select province ,city ,population from ( select province ,city ,population ,row_number() over(partition by province order by population desc) rnk from table ) tmp where rnk <= 3 ;