Re: Select multiple records with ORDER BY

From: Matt Theodoseau <mtheo_at_corp.idt.net>
Date: 1997/03/17
Message-ID: <332D07BA.3627_at_corp.idt.net>#1/1


Joseph Jao wrote:
>
> It am trying to select multiple records from a table that is to be
> sorted first. I have trouble coming up with a SQL command that selects
> 3 names in a company that earn the top salaries. If I say
>
> "select name, sal from emp where rownum <4 order by sal desc;",
>
> it only gives me the first 3 names without sorting. Can anyone share
> his wisdom with me?

Try using a hint INDEX_DESC -- on the sal column (sal column must be indexed)

have fun !!! Received on Mon Mar 17 1997 - 00:00:00 CET

Original text of this message