SQL對某個字段進行排名

SELECT
    ( @rowNO := @rowNo + 1 ) AS rowno,
    a.badge,a.NAME,a.direct_evaluate_rate,a.view_rate
FROM
    ( SELECT * FROM `hrs_stat_job_evaluate_manage` WHERE TYPE='30days' AND position_role='M' ) a,
    ( SELECT @rowNO := 0 ) b 
ORDER BY
    a.view_rate DESC
相關文章
相關標籤/搜索