DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Select Row Number In MySQL

01.13.2009
| 19794 views |
  • submit to reddit
        http://www.hackszine.com/blog/archive/2008/12/selecting_row_number_in_mysql.html?CMP=OTC-7G2N43923558

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