Re: TOP 100 in SQL
Posted in 1998
without the first 100 capability:
1. create a view x (a, total) as
select a, sum(b) from c
group by a;2. then select a, total from x t1
where (select count(a) from x t2 where t2.total >
t1.total) < 100
It works --- but it is expensive. better to write application.
Doug Agnew (dagnew@charlottepipe.com)
rfurdzik@paulweiss.com wrote:
> How to display only first 100 rows from a query ??? Please help
>
> Select a, sum(b)
> group by a DESC>
> __________________________________________________
>
> This message is intended only for the use of the=20
> Addressee and may contain information that is=20
> PRIVILEGED and CONFIDENTIAL=2E If you are not the
> intended recipient, you are hereby notified that
> any dissemination of this communication is
> strictly prohibited=2E If you have received this
> communication in error, please erase all copies of
> the message and its attachments and notify us
> immediately=2E Thank You=2E
> __________________________________________________