SQL Query to return N rows from dual

前端 未结 10 1842
盖世英雄少女心
盖世英雄少女心 2021-02-13 10:31

I want to write a SQL query which accepts a bind variable (say :NUM) and its output consists of one column & :NUM number of rows, each row having its row number. i.e. if we

10条回答
  •  [愿得一人]
    2021-02-13 11:29

    Query without connect by

    WITH num(n) as(select 1 from dual union all
    select n+1 from num where n <= :num_limit)
    select * from num
    

提交回复
热议问题