1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Question in select statement ???

Discussion in 'SQL PL/SQL' started by waheeb, Aug 25, 2016.

  1. waheeb

    waheeb Active Member

    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    80
    Location:
    yemen
    using a select statement ,a user enters a number,then the select statement returns all numbers starting from 1 to the entered number.
    For example,if the user enters (10) ,then the returned values should be like this:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
  2. Silambarasan K

    Silambarasan K Active Member

    Messages:
    6
    Likes Received:
    3
    Trophy Points:
    85
    Location:
    Chennai
    Hi waheep ,
    You can get your requirement from below query ,

    SELECT LEVEL
    FROM DUAL
    CONNECT BY LEVEL <=&N ;

    if you give n=10 then it will display up to 10
     
  3. Siddhartha

    Siddhartha Active Member

    Messages:
    16
    Likes Received:
    2
    Trophy Points:
    90
    Location:
    Bangalore
    Select level from dual connect by level < =&n;
     
  4. waheeb

    waheeb Active Member

    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    80
    Location:
    yemen
    thank U all so much