34,588
社区成员
![](https://csdnimg.cn/release/cmsfe/public/img/topic.427195d5.png)
![](https://csdnimg.cn/release/cmsfe/public/img/me.40a70ab0.png)
![](https://csdnimg.cn/release/cmsfe/public/img/task.87b52881.png)
![](https://csdnimg.cn/release/cmsfe/public/img/share-circle.3e0b7822.png)
Select id,cast(name as varchar(6000)) as name from 表B WHERE ID NOT IN(SELECT ID FROM 表A)
UNION ALL
Select id,cast(name as varchar(6000)) as name from 表A
SELECT ISNULL(A.ID,B.ID) AS ID,
ISNULL(A.NAME,B,NAME) AS NAME
FROM A FULL JOIN B
ON A.ID=B.ID