Time type amount
1 of 1000
2 of 1600
Table 2
Time type amount
1 500
2 500
Table 3
Time type amount
1 put 100
2 the trip 500
Now want to use an SQL statement, calculate the amount of table 1 and table 2 amount and reduction amount in table 3
I'm using the ACCESS database
CodePudding user response:
Select a.s - b.s - c.s. as s1 from (select sum (amount) as a s the from table) as a, (select sum (amount) as s from table 2) as b, (select sum (amount) as s from table 3) as c
CodePudding user response:
Amount - select a. b. - c. payable amount asFrom table 1 a
The join table 2 b on a. time=b.
Time=the join table 3 c on a. c. time
CodePudding user response: