Re: SQL Question, first 50 of a query

From: Pierre <pierre_at_pathcom.com>
Date: 1996/06/01
Message-ID: <4oo8of$u3m_at_news.pathcom.com>#1/1


"Michael J. Pantaleano" <mike.pantaleano_at_ab.com> wrote:

>Hadar Paiss wrote:
>>
>> Michael Brodesky wrote:
>> >
>> > I am trying to do the top50 in sql that is provided by
>> > access, but in oracle 7.2. Anyone know how to do this?<<snip>>
>> > Michael
>> <<snip>>
>> 2. You can get the top 50 using something like:
>> select ename,sal
>> from emp a
>> where 50 < (select count(*)
>> from emp b
>> where a.sal > b.sal)<<snip>>
 

>For number 2,
 

>How about:
 

> select ename, sal
> from emp
> where ROWNUM < 51;
 

>--
>Michael J. Pantaleano <mike.pantaleano_at_ab.com>
>The opinions expressed above are not that of the people who pay me.

This is first 50, not TOP50

Best regards,

Pierre mailto:pierre_at_pathcom.com http://www.pathcom.com/~pierre



"We'll cross that bridge when we come to it." Ted Kennedy Received on Sat Jun 01 1996 - 00:00:00 CEST

Original text of this message