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 -> Re: sql question

Re: sql question

From: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 24 May 2005 09:27:10 -0700
Message-ID: <1116951764.887273@yasure>


cazman wrote:
> Hi all,
>
> Let's say I have the fallowing table:
>
> tbl 1
>
> col1 col2 col3 val
> 1 2 s 45
> 1 2 k 84
> 1 2 p 42
> 4 5 s 96
> 4 5 k 66
> 4 5 p 44
>
>
> I would like to write a query to get the fallowing result:
>
> col1 col2 res
> 1 2 (s-k /p)
> 4 5 (s-k /p)
> (s-k /p): this is a math operation, taking the val column for the
> respective s, k and p values.
>
> So, the result would be:
>
> col1 col2 res
> 1 2 -0.928
> 4 5 0.6818
>
>
>
> Thanks!

Then do so.

And if it doesn't work post your best effort and we will give you hints to help you.

-- 
Daniel A. Morgan
Relational theory is not something that is simply a nice-to-have.
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Tue May 24 2005 - 11:27:10 CDT

Original text of this message

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