fetching data using rownum in oracle

前端 未结 3 1583
梦如初夏
梦如初夏 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:35

    Syntax seems correct to me.

    However ROWNUM is calculated on result rows for example:

    SELECT * FROM TABLE_NAME WHERE ROWNUM < 10 ORDER BY TABLE_FIELD ASC;
    

    and

    SELECT * FROM TABLE_NAME WHERE ROWNUM < 10 ORDER BY TABLE_FIELD DESC;
    

    Will give you different results.

    Each time a query is executed, for each tuple, Oracle assigns a ROWNUM which is scopet to that only query.

    What are you trying to accomplish ?

提交回复
热议问题