update a,b set a.name=b.name where a.id=b.id coalesce(被查字段,默认值) null 时用 select Id,coalesce(num,0) as num from aaa