Skip to content

Changelog

New updates and improvements at Cloudflare.

Back to all posts

Basin SQL supports OFFSET

View as MarkdownAgent setup

Basin SQL is a serverless, distributed SQL engine for querying Apache Iceberg tables in Basin Catalog. It now supports OFFSET, which lets you skip a specified number of rows when retrieving query results.

Use LIMIT to set the page size and OFFSET to skip earlier rows. With a page size of 100, use OFFSET 0 for the first page, OFFSET 100 for the second, and increase the offset by 100 for each later page. Add ORDER BY on a unique column to keep the row order consistent.

For example, this query returns the second page of 100 rows:

SELECT sale_id, total_amount
FROM my_namespace.sales_data
ORDER BY sale_id
LIMIT 100 OFFSET 100

For syntax and examples, refer to the OFFSET clause in the Basin SQL reference.