Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 How do I select the TOP 10 records in Oracle

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-12-06 : 15:25:06
Brian writes "I know in SQL Server you can select the TOP 10 records in a
query. I am having trouble taking the top 10 records in an
Oracle query. I have tried the following query but it gives an
error saying that I am missing a right parenthesis.

SELECT * FROM (SELECT WONUM, STATUS, DESCRIPTION, REPORTDATE
FROM WORKORDER
WHERE STATUS = 'OPEN'
AND SUPERVISOR LIKE '2110%'
ORDER BY REPORTDATE)
WHERE ROWNUM < 11

The sub-query runs fine by itself. For some reason though it
doesn't like the above query. If you see something wrong, or
you know a better way to select the top 10 oldest records
please let me know. Thanks."
   

- Advertisement -