Get a Quote Right Now

Edit Template

Adding OFFSET expression

Adding an SQL OFFSET expression is easy as:

createQueryBuilder("user").offset(10)

Which will produce the following SQL query:

SELECT ... FROM users user OFFSET 10

The resulting SQL query depends on the type of database (SQL, mySQL, Postgres, etc). Note: OFFSET may not work as you may expect if you are using complex queries with joins or subqueries. If you are using pagination, it’s recommended to use skip instead.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *