select isnull(a.姓名,b.姓名)
from a full join b
on a.姓名=b.姓名
where a.姓名 not in
(select a.姓名
from a,b
where a.姓名=b.姓名)
from a full join b
on a.姓名=b.姓名
where a.姓名 not in
(select a.姓名
from a,b
where a.姓名=b.姓名)
解决方案 »
- 求一个sql查询问题
- 简单的问题,查询数据库中第 N 条记录
- 取字符串
- BCP的问题,在线等
- 菜菜求教~~~~~~~~
- 怎样给sqlsever2008 做个服务端程序?
- SQL server vk 如何能暫時不要將操作改入log中,如oracle的alter table tablename no loggging,請指點!謝謝
- sql 2005 新建维护计划时出现错误“找不到文件夹"Maintenance Plans"”
- 存储过程啊存储过程?
- 求一个sql语句
- win2000+sql-Server为什么数据库总是崩溃?偶用的是250G S-ATA硬盘
- 救急:关于sp中用游标把excel的数据一条条导入已经存在的表中
from a,b
where a.姓名=b.姓名
from a,b
where a.姓名=b.姓名
union
select 姓名 from b where not exists(select 1 from a where 姓名=b.姓名)
from a
where a.姓名 not in (select b.姓名 from b)---
选择所有a表中有而b表中没有的姓名select b.姓名
from b
where b.姓名 not in (select a.姓名 from a)
---
选择所有b表中有而a表中没有的姓名