I got stuck writing a query for Firebird today. And here I was thinking that SQL was a standard — if only the “S” were for “Standard”…

I was busy writing scripts at work to paginate results in our BI portals. In MySQL I would usually write something like this to return the first 20 records:

Not so in Firebird:

In the MySQL, the 1 denotes from which record to start, and the 20 how many records to return. In the Firebird syntax, the FIRST denotes the number of records to return, and the SKIP specifies from which record to start.

Naturally, to effect the pagination, you would use variables passed between the pages to control moving between sets of records.

The support for Firebird is nothing like that for MySQL — and it took me quite a while to find the answer. Sometimes the geeks disappoint…

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