mysql 獲取排序後的排名

SELECT id,(@rownum:=@rownum+1) AS rownum FROM test t,(SELECT @rownum:=0) r WHERE *** ORDER BY id DESC;
相關文章
相關標籤/搜索