select isnull(d.col1,0)col1 ,isnull(d.col2,0) col2, isnull(b.col3,0)col3 into temp1 from b left join
(select col1,col2,c.name,c.id from a , c where a.id=c.id )as d
on b.name=d.name
然后select * from temp1
select isnull(d.col1,0)col1 ,isnull(d.col2,0) col2, isnull(b.col3,0)col3 into temp1 from b left join
(select col1,col2,c.name,c.id from a , c where a.id=c.id )as d
on b.name=d.name