Thursday, April 4, 2013

How could you select the first N rows in MySQL?

# Retrieve first 5 rows, equivalent to: limit 0,5
SELECT * FROM <TableName> Limit 5;

# Retrieve rows 6-10
SELECT * FROM <TableName> Limit 5,10;

No comments :