Subject Re: [firebird-support] Firebird and LIMIT
Author Norman McFarlane
To Alan, Martijn and Svein,
Thanks so much for your suggestions.
Both "select first..." and "rows n to n" work magnificently.
I've also downloaded the release notes, Alan. thanks for the suggestion.
Regards,
Norman
----- Original Message -----
From: Alan.Davies@...
To: firebird-support@yahoogroups.com
Sent: Monday, September 08, 2008 2:12 PM
Subject: Re: [firebird-support] Firebird and LIMIT


select first 20 <your_column_name> from <your_table_name>
where <your_column_name>=<your_condition>
order by your_column_name
returns the first 20 rows.
e.g.
select first 20 account_name from supplier
where account_name between 'A' and 'B'
order by account_name

Most of your answers to this sort of question are in the Firebird
Release notes - freely downloadable.

HTH
--
Alan J Davies
Aldis

Quoting Norman McFarlane <norman@...>:

> Hi group,
> I'm converting an app from MySQL to FB. One of the bothersome issues
> is syntax.
> MySQL has the LIMIT modifier which takes a numeric argument,
> limiting the number of rows retuend by a query.
> MSSQL has an equivalent in TOP. does Firebird have anything like this?
> Obviously, one is inclined to think of the WHERE clause, but since
> you are not certain of what you're going to get back, until you've
> gotten it, it is not always possible to limit on the basis of the
> WHERE clause.
> Any suggestions as to how to overcome this problem?
> Regards,
> Norman
>
> [Non-text portions of this message have been removed]
>
>






------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.169 / Virus Database: 270.6.19/1659 - Release Date: 9/8/2008 7:01 AM


[Non-text portions of this message have been removed]