Re: SQL Question, first 50 of a query

From: Michael J. Pantaleano <mike.pantaleano_at_ab.com>
Date: 1996/05/28
Message-ID: <31AB26DB.4BC2_at_ab.com>#1/1


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.
Received on Tue May 28 1996 - 00:00:00 CEST

Original text of this message