1:数据表
2:问题:查询各个部门的最低工资的userid号
select a.* from
(select ROW_NUMBER() over(partition by dept order by salary asc) rn,userid,salary,dept from salary ) a
where rn=1
3:分析
partition by dept 是对dept进行分组,、
order by salary 分组后按salary进行排序
select ROW_NUMBER() over(partition by dept order by salary asc) rn,userid,salary,dept from salary