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

Home -> Community -> Usenet -> comp.databases.theory -> Re: Difference within a field between records

Re: Difference within a field between records

From: who me <snooze241_at_hotmail.com>
Date: 20 Jan 2002 19:11:32 -0800
Message-ID: <a05c28e0.0201201911.637c8658@posting.google.com>


It depends what you are trying to do here

select size = (a.mass - b.mass)
from table a, table b
where a.weekID = 1 and b.weekID = <2 or (a.weekID + 1 and a.weekID not mentioned)> and a.tankID = b.tankID

you can also use a group by cluase and having here.

I am not sure if this is what you are looking for.

Hope this helps. Is this for school?

Eric

John Eggert <eggert_at_sympatico.ca> wrote in message news:<3C4B2081.16099320_at_sympatico.ca>...
> Hi:
>
> Is this as hard as it seems?
>
> Table:
>
> weekID tankID Mass
> 1 1 150
> 2 1 250
>
> Calculate the increase in mass in tank 1 over the week (in this case 250
> - 150 = 100). Call this production. Production will be reported. Weekly
> production over the previous n years will be used as input for
> statistical analysis.
>
> Thanks
>
> JE
Received on Sun Jan 20 2002 - 21:11:32 CST

Original text of this message

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