Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> "un-grouping" results

"un-grouping" results

From: <sdbillsfan_at_gmail.com>
Date: 3 Feb 2005 13:08:24 -0800
Message-ID: <1107464904.799451.218110@o13g2000cwo.googlegroups.com>


All-

     I'm looking for a way to pretty much do the opposite of a group by, count statement. Assuming I have a table with the following data:

ID     Quantity

-- --------
1 4 2 3

How would I use a select statement to return the following result set?:

ID
--

1
1
1
1
2
2
2

Where I return a separate row for each id up to the quantity value for that row. I have a solution in place using a temp table and cursor but I figure there must be a better way.

Thanks in advance. Received on Thu Feb 03 2005 - 15:08:24 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US