34,593
社区成员
发帖
与我相关
我的任务
分享
select
a.*,isnull(b.数量,0) 数量
from
a
left join
b
on
a.ModelType=b.ModelType and a.No=b.No and a.Code=b.Code
and
a.位置=b.位置
Select A.*,isnull((select 数量 from B
where ModelType=A.ModelType and No=A.No and Code=A.Code
and 位置=A.位置),0) AS 数量 from A
Select A.*,isnull(b.数量,0) AS 数量 from A
left join b
on a.ModelType=b.ModelType and a.No=b.No and a.Code=b.Code and a.位置=b.位置