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

sql question

From: cazman <remi_gagne_at_hotmail.com>
Date: 24 May 2005 07:08:52 -0700
Message-ID: <1116943732.687342.235850@f14g2000cwb.googlegroups.com>


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! Received on Tue May 24 2005 - 09:08:52 CDT

Original text of this message

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