Subject Re: [firebird-support] Firebird equivalant to "LIMIT"
Author Helen Borrie
At 08:57 AM 15/04/2007, you wrote:
>Hi.
>
>While migrating queries with a row limit, I noticed Firebird errors
>with a unknown token error where "limit" occurs.
>
>For example, "select * from data order by date desc limit 200" to pull
>only the LAST 200 rows entered.
>
>Is there a Firebird equivalent I can use to keep queries from
>returning 10000 rows when I only need a few??

SELECT FIRST 200 from data order by date desc

You can also use a SKIP n clause to begin fetching from the (n+1)
record in the set.

For this syntax see the v.1.5.4 release notes.

V.2.0 introduces the SQL 200x syntax for a similar thing: refer to
the ROWS syntax in the the v.2.0.1 release notes.

./heLen