ELECT userId
, (@rowNum := @rowNum + 1) AS runRank
, mostFast1 FROM
user_info, (SELECT (@rowNum := 0)) b
WHERE
mostFast1 IS NOT NULL
ORDER BY
mostFast1
这种方式只能适用于不家group by的查询,如果加上group by那么排序就会有问题,至于什么原因不清楚
ELECT userId
, (@rowNum := @rowNum + 1) AS runRank
, mostFast1 FROM
user_info, (SELECT (@rowNum := 0)) b
WHERE
mostFast1 IS NOT NULL
ORDER BY
mostFast1
这种方式只能适用于不家group by的查询,如果加上group by那么排序就会有问题,至于什么原因不清楚