开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜