tags:

views:

19

answers:

1

How can I get the row number in the returned mysql query , (i.e) if my query is returning some 5 rows as a result for ex... I wan to know that is 1st,2nd, 3rd ...etc

thaks in advance

+1  A: 
SELECT @row := @row + 1 as row, t.*
FROM some_table t, (SELECT @row := 0) r
Haim Evgi
+1 That's a really nice one-liner!
xPheRe