from (select tid, sum(num) as sum from A order by tid)a,
(select tid, sum(num) as sum from B order by tid)b
where a.tid = b.tid
试一下上面的sql语句行不行
select Aa.Aamount -B.stock , B.bookidfrom (select sum(A.amount) as Aamount , A.bookid from group by A.bookid ) Aa inner join B on Aa.bookid =B.bookid上述用的是sql2000 的语法。但都类似。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)