0

I am new to MySQL database. So I want to know the exact SQL query to fetch Nth row. Please help me solve this issue. Thanks in advance.

0

1 Answer 1

1
SELECT * 
FROM YourTable 
ORDER BY <somefield>
LIMIT N-1, 1

http://www.w3schools.com/php/php_mysql_select_limit.asp

The SQL query below says "return only 10 records, start on record 16 (OFFSET 15)":
$sql = "SELECT * FROM Orders LIMIT 10 OFFSET 15";

You could also use a shorter syntax to achieve the same result:
$sql = "SELECT * FROM Orders LIMIT 15, 10";

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.