--排序后的记录进行标号
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
--排序后的记录进行标号
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