查询A表,跟B表不相同的数据 例:A表,中有,a,b,c字段,B表中也有a,b,c字段,两个表结构是一样的.我想要的是,查询A表中,a字段等于B表中的a字段,但是A表中的c字段不等于B表中的c字段的数据.像这种查询语句如何编写 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from ta t where exists(select 1 from tb where a=t.a)and not exists(select 1 from tb where c=t.c) select *from a where exists(select * from b where a.a=b.a and a.c<>b.c) select * from ta a,tb bwhere a.a=b.a and a.c<>b.c select *from a where exists(select 1 from b where a.a=b.a and a.c<>b.c) select * from a where exists(select 1 from b where a.a=b.b and a.c!=b.c) select A表.a,A表b,A表.c from A表,B表 Where A表.a=B表.b And A表.c<>B表.c ---写错了一点点select * from a where exists(select 1 from b where a.a=b.a and a.c!=b.c) select A表.a,A表b,A表.c from A表,B表 Where A表.a=B表.a And A表.c<>B表.c select * from a where not exists(select 1 from b where a.a=b.b and a.c=b.c) 再问个SQL语句 问个基础问题,存储过程是不是自动作为一个TRANSACTION来处理的? SQL组合查询的问题 问,如何克服SQL语句中的特殊字符? odbc配置错误提示: Sql语句问题。帮忙看看 A表 和 B表 建立级联的问题 急急急!!!SQL2000关于关键字处理问题!!!在线等~~~ sql server有什么函数能取得字符串的字节数,而非字符数 关于左关联和右关联的问题 sql in 查询 SQL Server 中@符号表示什么意思啊
and not exists(select 1 from tb where c=t.c)
from a
where exists(select * from b where a.a=b.a and a.c<>b.c)
select * from ta a,tb b
where a.a=b.a and a.c<>b.c
from a
where exists(select 1 from b where a.a=b.a and a.c<>b.c)
select * from a where exists(select 1 from b where a.a=b.a and a.c!=b.c)