2

limit 5, *

Mysql has a great clause to make a subset of a SELECT query: LIMIT. With just 1 parameter (example 1) the value specifies the number of rows to return from the beginning of the result set. With two arguments (example 2), 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). This is all very simple and trivial.

SELECT * FROM tbl LIMIT 5; # example 1 - the first 5 records
SELECT * FROM tbl LIMIT 10, 5; # example 2 - record 11 till 15

But there’s a problem when you want all the records BUT the first x. LIMIT 5, * is not possible in MySQL. The only way you can achieve this is to use a very high value as second parameter. It is not a very nice solution, but it works.

SELECT * FROM tbl LIMIT 5, 99999999999999