Home » RDBMS Server » Server Administration » can Sequence be generated using JUST ome select statement...
can Sequence be generated using JUST ome select statement... [message #371113] Wed, 30 August 2000 10:55 Go to next message
Hari
Messages: 59
Registered: August 2000
Member
Can sequence of integers be selected with just one select statement..
i want the select statement to select numbers between A and B...
where a = 10 and b = 20.
output shud be
10,11,12,13,14,15.....20 ..no cursor shud be used
Re: can Sequence be generated using JUST ome select statement... [message #371114 is a reply to message #371113] Wed, 30 August 2000 11:46 Go to previous message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
You could use something like this:

SELECT ROWNUM + (20 - 10 - 1)
FROM any_big_table
WHERE ROWNUM <= (20 - 10 + 1)

The problem is that "any_big_table" must be a table having at least 20 - 10 rows in it. If b - a is a big number you have a problem...
Previous Topic: unique index on pl/sql tables
Next Topic: Problem with AIX permissions creating a datafile
Goto Forum:
  


Current Time: Sat Oct 24 04:52:28 CDT 2020