MYSQL怎么实现两个表求和相减 求这样的SQL语句

2024-11-23 09:52:21
推荐回答(1个)
回答1:

select Aa.Aamount -B.stock , B.bookid from (select sum(A.amount) as Aamount , A.bookid from group by A.bookid ) Aa inner join B on Aa.bookid =B.bookid

上述用的是sql2000 的语法。但都类似。