Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Help With Query Syntax
I want to distribute the value of some field over multiple rows. Best to explain by example; here's the query I need to modify:
SELECT col1, col2, col3, quantity1
FROM table1
Now suppose there's one record in table1:
'val1', 'val2', 'val3', 850
I want each record to return quantity in groups of 250. My results should look like this:
val1 val2 val3 250
val1 val2 val3 250
val1 val2 val3 250
val1 val2 val3 100
So the sum of the rows is 850 but the value in each row is not greater than 250 (or some other number). How can I accomplish this in Oracle (SQL*Plus v3.3.3.0.0)? Thanks for any help at all.
-jk
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Nov 09 2000 - 10:44:14 CST