Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL Select TOP in Oracle

Re: SQL Select TOP in Oracle

From: TurkBear <noone_at_nowhere.com>
Date: Fri, 19 Jan 2001 11:24:15 -0600
Message-ID: <qotg6tkaso7cs3nfn3lijg8bda5iugf4em@4ax.com>

In Oracle ( consistent with good relational design) TOP is not a supported function:

Use this:
Select * from (select * from students where DEPT=44 order by STUID) where rownum < 11;

( This is for 8.1.6 and above...)

If ordering is not essential then
select * from students where DEPT=44 and rownum < 11 will work...

"JF" <john.fitzgerald_at_mainframe.co.uk> wrote:

>How do I limit the number of records returned in a select query i.e. in SQL
>Server 7+ the following works
>
>Select Top 10 * from STUDENTS where DEPT =44 order by STUID
>
>Which will return the first 10 students
>
>I've tried looking in Oracle docs and can't find an equivalent to TOP
>Help
>
>JF
>
Received on Fri Jan 19 2001 - 11:24:15 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US