select 出两上字段不同时等于另一个表中相同字段的记录 tableA :A,B,C字段tableB: A,B 字段要select 出tableA中a,b字段不同时等于tableB中a,b值的记录 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select A,B,C from tableAwhere not exists(select 1 from tableB where A=tableA.A and B=tableA.B) select * from tableAwhere not in (select tableA.a,tableA.b,tableA.c from tableA ,tableB where tableA.a=tableB.a and tableA.b=tableB.b) 还是用 not exists 比较好 select a.* from tableA A inner join tableB b on a.a=b.a and a.b<>b.b or a.a<>b.a and a.b=b.b select A,B,C from tableAwhere not exists(select 1 from tableB where A=tableA.A and B=tableA.B)...............就是这个了. select *from tableA awhere not exists(select 1 from tableB b where a.a=b.a and a.b=b.b) 请问选择题~~~ 一个系统参数表,只有一行,每次只允许一个用户取数据,取成功且更新后,才能允许其他用户取,该如何作? 这样的数据关系,数据表要怎么设计? 你给力,我给分,强烈求助一个统计SQL语句. sp_executesql中的参数如果是float类型就不能比较大小???? 获取记录同时又需要更改一个字段的值,怎么做? 数据类型的问题 求一SQL语句 紧急求救,SQL数据库文件不见了,有半年前的完整备份,现在有办法恢复过来吗? 怎么列齐12个月 求助, 碰到两道面试难题, 不知道有没有高人指点一下? 建超大表的疑问
where not exists(select 1 from tableB where A=tableA.A and B=tableA.B)
where not in (select tableA.a,tableA.b,tableA.c from tableA ,tableB
where tableA.a=tableB.a and tableA.b=tableB.b)
where not exists(select 1 from tableB where A=tableA.A and B=tableA.B)
...............就是这个了.
from tableA a
where not exists(select 1 from tableB b where a.a=b.a and a.b=b.b)