Saturday, March 16, 2013

put intry number on every entry in mysql

you can say.. it will show the position of entry



SELECT
    @row_number := IFNULL(@row_number, 0) + 1 AS row_number,
    id,
    data
FROM abc
WHERE 1 = 1





entry_position id name
1 5255 sudhir
2 54585 mohan
here 1 and 2 will show automatically

No comments:

Post a Comment