How can I get the row number in the returned mysql query? Let say, if my query is returning some 5 rows as a result, I want to know that row is 1st,2nd, 3rd etc.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
SELECT @row := @row + 1 as row, t.*
FROM some_table t, (SELECT @row := 0) r