Oracle top 1 record

To select the top 1 records from an oracle database, you filter with the where statement on rownum = 1:

select * from my_table where rownum = 1

If you want to select top 10 records from the table you use the following statement:

select * from my_table where rownum <= 10

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.