Possible Duplicate:
ROW_NUMBER() in MySQL
Is this possible? I want to get a bunch of results in a specific order and then find out the position of a row by its id, for example:
1, foo
2, bar
3, foobar
I want to get the position of 1 in Alphabetical order, it would return 2
Modified from this answer >> ROW_NUMBER() in MySQL