求一left /right join 语句,请大哥们帮忙哦!在线等待,解决立即结帖!!
rr 2004-09-14 10:27:34 语句如下。。
Select (case when A.total is null then 0 else A.total end) - (case when B.total is null then 0 else B.total end)
from (select sum(LeftAmtOrig) as total,tAccountID
from t_ArBill where Status <> '3' and tAccountID = '22' GROUP BY tAccountID ) as A
--------------------------------下面是关键,请问如何实现??谢谢哦
(case when A.total is null then right join
when B.total is null then left join
else join end)
------------------------------------
(select sum(LeftAmtOrig) as total,tAccountID from tReceiveBill
where Status <> '3' and checkFlag = 'A' and tAccountID = '22' GROUP BY tAccountID) AS B
on A.tAccountID = B.tAccountID