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
 PL/SQL and SELECT TOP 5 (Oracle)

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-10-26 : 11:58:23
Jeroen writes "Dou you know how to get the first five records from a query in Oracle? I can do this with ROWNUM but the problem occurs when I use an order by. See Query:

select naam from document where doc_id in (select document.doc_id from document,document_historie
where document.doc_id = document_historie.doc_id
and unit_id in (select unit_id from unit where org_id in(13,15))
order by document_historie.wijziging_datum desc, document_historie.wijziging_tijd desc) and rownum < 6

Greatings
a desperate developer"
   

- Advertisement -