Supporting the OFFSET clause

The following list shows which engines support the OFFSET clause and which don't:

  • MariaDB: Supported since 5.1
  • MySQL: Supported since 4.0.6
  • PostgreSQL: Supported since PostgreSQL 6.5
  • SQLite: Supported since version 2.1.0
  • Db2 LUW: Supported since version 11.1
  • Oracle: Supported since version 12c
  • Microsoft SQL Server: Supported since 2012

As you can see, limiting result sets is quite tricky and, when you are porting a commercial database to PostgreSQL, you will most likely always be confronted with some proprietary syntax.

Get Mastering PostgreSQL 10 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.