Oracle 分析函数row_number() over (partition by order by ) 的 Mysql的替代方法
--比较高效selectempid,deptid,salary,rankfrom(selectheyf_tmp.empid,heyf_tmp.deptid,heyf_tmp.salary,@rownum1:=@rownum1+1,if(@pdept=heyf_tmp.deptid,@rank:=@rank+1,@rank:=1)asrank,@pdept:=heyf_tmp.deptidfrom(