Limit The Number of Rows Returned by An Oracle Query

How do I limit the number of rows returned by an Oracle query?


Oracle. (source: www.dbtalks.com)


In Oracle, the only thing people mention is the rownum pseudo-column

select * from sometable where rownum <= 10

SELECT column_name(s) FROM table_name WHERE ROWNUM <= number;

Example in Java

stmt.executeQuery("SELECT airlines,dep_time,arr_time,economi_rate FROM cms_flightdetails where ROWNUM <= 5");

SHARE

About Agung Pambudi

I am a Blogger with passion in business.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment