mysql5.6以下排序

SELECT
tt.id,
( @rowNum := @rowNum + 1 ) AS ranking
FROM
( select 5 as id union all select 4 as id union all select 3 as id union all select 2 as id union all select 1 as id
ORDER BY id
) tt
,( SELECT ( @rowNum := 0 ) ) as e

 

posted @ 2023-03-20 10:53  苏su  阅读(22)  评论(0编辑  收藏  举报