Subject | Re: [IBDI] Re: Firebird 1 |
---|---|
Author | Peter Morris |
Post date | 2001-05-30T15:59:41Z |
Is TOP an SQL standard ?
I thought TOP would select all items and then return the TOP ones. You seem
to be confusing it with FIRST which is different.
select first 10 * from MyTable order by Surname;
will select the first 10 and THEN order them
select top 10 * from MyTable order by Surname;
will select all records, order them, and then return only 10.
I *think* that is how they work.
Pete
===
http://www.HowToDoThings.com
I thought TOP would select all items and then return the TOP ones. You seem
to be confusing it with FIRST which is different.
select first 10 * from MyTable order by Surname;
will select the first 10 and THEN order them
select top 10 * from MyTable order by Surname;
will select all records, order them, and then return only 10.
I *think* that is how they work.
Pete
===
http://www.HowToDoThings.com
----- Original Message -----
From: Ian A. Newby <ian@...>
To: <IBDI@yahoogroups.com>
Sent: Wednesday, May 30, 2001 8:16 AM
Subject: [IBDI] Re: Firebird 1
> Hi Bill,
> I think a rowid in conjunction with a TOP is the best choice. TOP
> should allow the engine to optimise selecting the first x rows rather
> than all the rows.
>
> a rowid would also allow more flexibility in other areas; ie I am in
> the middle of developing a java HTML reporter which combines data from
> SQL resultsets with HTML templates. Being able to select a rowid and
> perform functions on it would allow me to change the formating of
> every fifth row for example just by changing the template.
>
> Regards
> Ian Newby.
>
>
> Community email addresses:
> Post message: IBDI@yahoogroups.com
> Subscribe: IBDI-subscribe@yahoogroups.com
> Unsubscribe: IBDI-unsubscribe@yahoogroups.com
> List owner: IBDI-owner@yahoogroups.com
>
> Shortcut URL to this page:
> http://www.yahoogroups.com/community/IBDI
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>