解决方法是通过预定义用户变量来实现:
SET @rowNum = 0;
SELECT (@rowNum := @rowNum + 1) AS rowNum,id FROM recommend
本文共 145 字,大约阅读时间需要 1 分钟。
解决方法是通过预定义用户变量来实现:
SET @rowNum = 0;
SELECT (@rowNum := @rowNum + 1) AS rowNum,id FROM recommend
转载于:https://my.oschina.net/u/2963821/blog/1511336