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

Home -> Community -> Usenet -> c.d.o.tools -> Help With Query Syntax

Help With Query Syntax

From: contrapositive <contrapositive_at_my-deja.com>
Date: Thu, 09 Nov 2000 16:44:14 GMT
Message-ID: <8uek8s$1cl$1@nnrp1.deja.com>

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

Original text of this message

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