Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL Select TOP in Oracle
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