zawedx
03-26-2009, 11:08 AM
if i have a table like:
id | btype | bnum
1 | 0 | 10
1 | 0 | 5
1 | 10 | 4
1 | 10 | 3
is it possible to use a single SQL command to query the different of "bnum" base on "btype" of id "1". it should be (10+5)-(4+3) =8.
if not, what is the smartest way to do this.
thanks a lot for your kind help.
id | btype | bnum
1 | 0 | 10
1 | 0 | 5
1 | 10 | 4
1 | 10 | 3
is it possible to use a single SQL command to query the different of "bnum" base on "btype" of id "1". it should be (10+5)-(4+3) =8.
if not, what is the smartest way to do this.
thanks a lot for your kind help.