Possible Duplicate:
MySql Row Number?
I'd like to number the result of a query. Can I do that with mysql?
Let's say I have the following query
SELECT id
, application_id
, 3rd_column_to_generate From SemesterApplication
WHERE SemesterApplication.semester.id = 1
ORDER BY SemesterApplication.modified
I need the query to return a 3rd column that will hold the number of the result. If the query return 20 results, that 3rd column will return value between 1 and 20.
This query will be used as a sub-query in another query.