Re: How to limit number of rows
Posted in 1997
In article <5nkla2$718@cssun.mathcs.emory.edu>, Denham.M@amstr.com wrote:
>Use the program to do it, its about the best solution.
That's right. A 4gl program provides almost unlimited flexibility and
is probably the best choice.
However, you can use a correlated sub-query for your task.
But caution! Because of the way a correlated sub-query works, it will
be extremely slow if the number of rows in your table is anything
more than a few 1000.
select * from orders1 a
where 20 >
(select count(*) from orders1 b
where b.priority > a.priority)
order by priority
into temp holdall
>Do you think it's possible to do that or do I have to retrive "50" rows into
>my program
>and then do inserts?
>
----------------------------------------------
Rudy Fernandes
Frying Pan to the Freezer : Kuwait to Toronto
----------------------------------------------