SQLite with skip (offset) only (not limit)

Paul Knopf picture Paul Knopf · May 8, 2012 · Viewed 11.3k times · Source

I am trying to query a sql lite database with only an offset and no limit.

SELECT [Id], [Name], [IntValue], [IntNulableValue] FROM [Product] OFFSET 10

I can do an offset query when I have a limit however (LIMIT 10 OFFSET 10).

Here is the error sql lite is giving me.

SQLite error near "10": syntax error

Answer

Ming-Hong Bai picture Ming-Hong Bai · Oct 30, 2013

Just set LIMIT to -1.

For example:

SELECT * FROM table LIMIT -1 OFFSET 10