Query Help

From: Randy <randy_at_noceto.com>
Date: 7 May 2004 07:20:34 -0700
Message-ID: <ac0051fd.0405070620.7f80c28c_at_posting.google.com>



I'm trying to find a way to write a select statement that will create one column that is numbered from 0...n. I can't seem to find any way to do so. Is this possible?

The reason I am asking (in case there is some workaround), is that I have a 2-column table that looks as follows:

a 5
b 3

From this, I want to be able to use a select statement to create the following table:

a 5
a 4
a 3
a 2
a 1
a 0
b 3
b 2
b 1
b 0

This is for a view, so I do not think there is any way I can do any pl/sql. The only way I've been able to think of so far is creating a table by joining onto the rownum or primary key sequence from another table, but I'd really rather not do that if there's any way to avoid it.

Thanks in advance for any ideas. Received on Fri May 07 2004 - 16:20:34 CEST

Original text of this message