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: Brian Tkatch <SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK>
Date: Fri, 10 Nov 2000 13:16:08 GMT
Message-ID: <3a0bf317.861803328@news.alt.net>

Do you know the maximum value that any row has?

SELECT col1, col2, col3, 250 FROM Table1 WHERE quantity1 > 250

UNION ALL SELECT col1, col2, col3, 250 FROM Table1 WHERE quantity1 > 500

UNION ALL SELECT col1, col2, col3, 250 FROM Table1 WHERE quantity1 > 750

UNION ALL SELECT col1, col2, col3, MOD(Quantity1, 250) FROM Table1 WHERE MOD(Quantity1, 250) > 0;

Just a guess,
Brian

On Thu, 09 Nov 2000 16:44:14 GMT, contrapositive <contrapositive_at_my-deja.com> wrote:

>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 Fri Nov 10 2000 - 07:16:08 CST

Original text of this message

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