sql查询名次

select u.rowNo from (

select kpiId,userId,(@rowNum:=@rowNum+1) as rowNo
from kpi_Examination k,
(select (@rowNum :=0) ) b
order by k.totalScore desc,k.totalBonus desc


) u where u.userId = #{userId} and u.kpiId = #{kpiId};

 

展开阅读全文

没有更多推荐了,返回首页