Return the nth record from MySQL query
SELECT * FROM table ORDER BY ID LIMIT n-1,1
It says return one record starting at record n.
The accepted answer was wrong by 1 before the edit, because the offset is zero-indexed.
From the doc:
With two arguments, the first argument specifies the offset of the first row to return, and the second specifies the maximum number of rows to return. The offset of the initial row is 0 (not 1):
SELECT * FROM tbl LIMIT 5,10; # Retrieve rows 6-15
So the correct query would be
SELECT * FROM table ORDER BY ID LIMIT n-1,1
Use the limit clause (add 'limit 3, 1' to the end of your query to only select the third row).
Here's some more information: http://php.about.com/od/mysqlcommands/g/Limit_sql.htm
for example "LIMIT 10, 5", it will skip the number of records indicated by the first number and then show the number of records indicated by the second number. In other words it's "LIMIT skip, show".
SELECT * FROM tblTesting LIMIT 3, 6
will display from 4th record to 9th record, total records displayed 6
if you want show descending order use DESC
SELECT * FROM tblTesting ORDER BY column_name DESC LIMIT 3, 6