开发者

How can I count the row number in the returned group of mysql query?

开发者 https://www.devze.com 2023-01-22 17:46 出处:网络
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.SELECT @row := @row +

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.


SELECT @row := @row + 1 as row, t.*
FROM some_table t, (SELECT @row := 0) r
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号