| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Difference within a field between records
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
![]() |
![]() |