Skip to content

Instantly share code, notes, and snippets.

@ssokolow
Created December 23, 2009 13:02
Show Gist options
  • Select an option

  • Save ssokolow/262503 to your computer and use it in GitHub Desktop.

Select an option

Save ssokolow/262503 to your computer and use it in GitHub Desktop.

Revisions

  1. ssokolow created this gist Dec 23, 2009.
    8 changes: 8 additions & 0 deletions pagination_example.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    -- Reasonably efficient pagination without OFFSET
    -- SQLite version (Adapted from MS SQL syntax)
    -- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6

    SELECT foo, bar, baz, quux FROM table
    WHERE oid NOT IN ( SELECT oid FROM table
    ORDER BY title ASC LIMIT 50 )
    ORDER BY title ASC LIMIT 10