I try to select query an output that will limit the number or records returned, such as 10, how do I make such query?
Printable View
I try to select query an output that will limit the number or records returned, such as 10, how do I make such query?
Just at the End add
Where Rownum <= 10
Hope it will work.
Thanks
Thanks, it works!
Be careful with this if you're using an order by clause.
e.g. select * from emp
where rownum <= 10
order by emp_no
will return the first 10 rows and then sort them by emp_no.
It will not sort the data before selecting 10 rows.