select t.rn from
(select *,row_number() over(order by id) rn from 表名) t
where t.name='王五'
SELECT t.rn FROM
(SELECT *,ROW_NUMBER() over(ORDER BY `Joindate` DESC, `Sort` DESC, `NewsID` DESC,`ID` DESC) rn FROM `voc_xhn_channel_news` WHERE `type` = 1 AND `LocationID` = 2) t
WHERE t.ID = 153992;