Re: SQL Question, first 50 of a query
From: Michael E. Austin <austin_at_inmind.com>
Date: 1996/06/05
Message-ID: <4p2m10$qdh_at_mujibur.inmind.com>#1/1
Date: 1996/06/05
Message-ID: <4p2m10$qdh_at_mujibur.inmind.com>#1/1
Pierre (pierre_at_pathcom.com) wrote:
: "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>>
: >For number 2,
: >How about:
: > select ename, sal
: > from emp
: > where ROWNUM < 51
add>> order by sal;
: This is first 50, not TOP50
If you are trying to extract the top 50 salaries, adding the ORDER BY clause should get you what you want.
Optionally, you could use the same query in a cursor and do 50 fetches.
: Best regards,
I'll send you my bill... :)
: Pierre mailto:pierre_at_pathcom.com http://www.pathcom.com/~pierre : =================================================================== : "We'll cross that bridge when we come to it." Ted Kennedy
-- +========================================================================+ | Michael E. Austin | | MICHAEL AUSTIN, INC. | | A DATABASE CONSULTING FIRM | | The Platform only matters if you want performance | | Buy the BEST! Buy Digital Alpha and Oracle RDB | | austin_at_inmind.com http://www.inmind.com/people/austin | +========================================================================+Received on Wed Jun 05 1996 - 00:00:00 CEST