SELECT a.*, (@rowno:=@rowno+1) AS rowno FROM (SELECT SUM(sWeight) AS total, fkVip FROM TbPutGarbage GROUP BY fkVip ORDER BY total DESC) a,(SELECT (@rowno:=0)) b
排序.png
SELECT a.*, (@rowno:=@rowno+1) AS rowno FROM (SELECT SUM(sWeight) AS total, fkVip FROM TbPutGarbage GROUP BY fkVip ORDER BY total DESC) a,(SELECT (@rowno:=0)) b
排序.png
本文标题:MySql 对排序后的记录进行排号
本文链接:https://www.haomeiwen.com/subject/wkdhfktx.html
网友评论