Re: Difference within a field between records
Date: 20 Jan 2002 19:11:32 -0800
Message-ID: <a05c28e0.0201201911.637c8658_at_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 Mon Jan 21 2002 - 04:11:32 CET
