Subject RE: [firebird-support] Firebird and LIMIT
Author Svein Erling Tysvær
I'd say ORDER BY should be used with ROWS - if you don't care which row is returned, that would to me indicate that an EXISTS query could be more appropriate.

Set

-----Original Message-----
From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of Norman McFarlane
Sent: 8. september 2008 14:13
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Firebird and LIMIT

To Martijn and Sasha,

Wow! Thanks for such a prompt response.

So, something like "select c_name, c_familyname, c_id from contacts rows 1
to 1" will return the top row only in the result set?

Regards,

Norman



_____

From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Sasha Matijasic
Sent: 08 September 2008 02:00 PM
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Firebird and LIMIT



> 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?

select * from foo
where ...
rows n to m

or

select first n skip m from foo
where...
(this syntax is older, if you are using version 2 or above, use rows)

Sasha