A表和B表是两个完全相同的表,如何能找出A表有而B表没有的数据?

gd_huangyi 2007-03-07 05:32:02
A表和B表是两个完全相同的表,如何能找出A表有而B表没有的数据?
...全文
332 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
TopFans 2007-03-08
  • 打赏
  • 举报
回复
select * from a
minus
select * from b

集合操作是最快的

这明明是oracle里面的
虽然我不是很懂。。。。
SinGooCMS 2007-03-07
  • 打赏
  • 举报
回复
select * from a,b where a.字段*=b.字段and b.字段 is null.这样好像会在b没有值的地方补null.
顶select * from a where not exists(select * from b where a.字段=b.字段)
ynduanlian 2007-03-07
  • 打赏
  • 举报
回复
select * from a
minus
select * from b

集合操作是最快的
hrb2008 2007-03-07
  • 打赏
  • 举报
回复
select a.* from a full outer join b on a.col1=b.col1 and b.col2 is null
zsl5305256 2007-03-07
  • 打赏
  • 举报
回复
select * from a,b where a.字段*=b.字段and b.字段 is null
baoshan 2007-03-07
  • 打赏
  • 举报
回复
select * from a where not exists(select * from b where a.字段=b.字段)

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧