ORACLE SQL:Get all integers between two numbers

前端 未结 13 1291
说谎
说谎 2020-12-03 13:42

Is there any way to select the numbers (integers) that are included between two numbers with SQL in Oracle; I don\'t want to create PL/SQL procedure or function.

Fo

13条回答
  •  没有蜡笔的小新
    2020-12-03 13:58

    this single line query will help you,

    select level lvl from dual where level<:upperbound and 
    
                                  level >:lowerbound connect by level<:limt
    

    For your case:

    select level lvl from dual where level<10 and level >3 connect by level<11
    

    let me know if any clarification.

提交回复
热议问题