34,587
社区成员
发帖
与我相关
我的任务
分享
create table A(ID int)
insert A select 001 union all select 002 union all select 003
create table B(ID int,AMOUNT int)
insert B select 002,100
select A.ID , isnull(B.AMOUNT,0) as AMOUNT from A left join B on A.ID=B.ID
select a.id,isnull(amount,0) amount from a left join b on a.id=b.id
select a.id,isnull(amount,0) amount from a left join b on a.id=b.id