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 -> Re: Help With Query Syntax

Re: Help With Query Syntax

From: Guus <gkramer_at_wxs.nl>
Date: Thu, 9 Nov 2000 22:30:12 +0100
Message-ID: <8uf53p$dtmp$1@reader1.wxs.nl>

Hi jk,

You can solve you'r problem by using a cursor which subtracts 250 from 850 and store what it has already subtracted ( and compare it with the original value ( use and if then else statement )). It will be a simple + and - game.

Hope it solve your problem

Guus K ( Holland )

contrapositive <contrapositive_at_my-deja.com> schreef in berichtnieuws 8uek8s$1cl$1_at_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 - 15:30:12 CST

Original text of this message

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