Enabling LIMIT and OFFSET in DB2 9.7.2

In order to enable the new LIMIT and OFFSET syntax in DB2 9.7.2, you’ll need to execute the following commands:

$ db2set DB2_COMPATIBILITY_VECTOR=MYS
$ db2stop
$ db2start

With this enabled, you’ll be able to execute queries such as:

SELECT * FROM users LIMIT 5
SELECT * FROM users LIMIT 5 OFFSET 10

Get more stuff like this

Subscribe to my mailing list to receive similar updates about programming.

Thank you for subscribing. Please check your email to confirm your subscription.

Something went wrong.

5 Comments

  1. Leons Petrazickis June 2, 2010
  2. Arun Srini June 2, 2010
  3. Murad Iqbal May 9, 2012

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.