fetching data using rownum in oracle

前端 未结 3 1585
梦如初夏
梦如初夏 2021-01-23 11:04

I have a query in oracle to fetch data from table using rownum but i didn\'t get any data.
My query is like this :

select * from table-name wher

3条回答
  •  星月不相逢
    2021-01-23 11:42

    Since for the reasons rahularyansharma mentions, rownum based queries won't always function the way you might expect, a way around this is to do something like

    SELECT * from (SELECT rownum AS rn, TABLE_NAME.* FROM TABLE_NAME)
    where rn > 5;
    

    However, be aware that this will be a fairly inefficient operation when operating over large datasets.

提交回复
热议问题