select *,rank()over(partition by 部门编号 order by 薪水) as 薪水升序排名,
rank()over(partition by 部门编号 order by 薪水 desc) as 薪水降序排名
from 薪水表