feri baco
feri baco

Reputation: 635

MySQL: how to select everything except first 10 records

How can I select all records except first 10 records from MySQL table?

(I know that limit 10,x selects records from the 10th to x-th, but what should I use instead of x to select all remaining records?)

Upvotes: 6

Views: 5057

Answers (2)

Lucia Pasarin
Lucia Pasarin

Reputation: 2308

Use OFFSET. Then you can skip 10 records and select the remaining ones until the end.

Then your query should look like

SELECT field FROM table WHERE (condition) LIMIT 18446744073709551615 OFFSET 10;

Upvotes: 7

Tomasz Kapłoński
Tomasz Kapłoński

Reputation: 1378

Better get used to LIMIT condition because you can use it also for pagination.

Upvotes: 0

Related Questions