Subject | Re: [IBDI] function TOP n FROM... was (Porting from...) |
---|---|
Author | hannes hernler |
Post date | 2000-06-25T16:10:19Z |
Thank you Helen Borrie and Steve Tendon
-----Ursprüngliche Nachricht-----
Von: Helen Borrie <helebor@...>
Steves hint to use a subquery compareing sorted
integers is also a sophisticated solution.
But what about performance?
How fast is a subquery compared with an iterative
loop in a stored procedure?
This was the idea behind my asking for TOP function
if it´s implemented in servers standard functions it could be faster?
hannes
-----Ursprüngliche Nachricht-----
Von: Helen Borrie <helebor@...>
>create procedure TOP_N(n integer, LastID integer)A stored procedure like this was in my mind too.
>returning (sFirstName varchar(30), sLastName varchar(30), dBirthday date)
>...
>iCounter = 0;
>... iCounter = :iCounter + 1;
> if iCounter = :n then Exit;
>....
Steves hint to use a subquery compareing sorted
integers is also a sophisticated solution.
But what about performance?
How fast is a subquery compared with an iterative
loop in a stored procedure?
This was the idea behind my asking for TOP function
if it´s implemented in servers standard functions it could be faster?
hannes