两个表怎么找出不同的数据?高分 select * from b where not exists(select * from a where a.gx=b.gx and a.date=b.date) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from b where not exists(select * from a where gx=b.gx and date=b.date) select * from b where not exists(select * from a where a.gx=b.gx and a.date=b.date) select b.*from B left join A on a.gx=b.gx and a.date=b.datewhere a.gx is null 你的例子:select * from b as b1 where not exists (select 1 from a where a.gx=b.gxand a.[date]=b.[date] ) select * from b where not exists(select * from a where a.gx=b.gx and a.date=b.date) select * from 表B where not exists (select 1 from 表A where 表A.gx=表B.gx and 表A.date=表B.date) victorycyz(中海) 的是正确的。 select * from B where not exists (select * from A where A.gx=B.gx and A.date=B.date) 樓主按照你的要求語法應該按下面的寫:select * from b where gx not in (select gx from a ) and date not in ( select date from a) left outer join 效率高些,同意victorycyz(中海)的! 有时间的大虾帮忙看下 关于成绩相同,并列第N的问题 sql中如何对查出的列进行统计 sql的最基本查询语句 在SQL Server中怎样访问InterBase数据库? 2台机器设计镜像互为伙伴 SQL Server2000个人版可否将数据库导出到另外一台机器上?(up有分) pb8.0连接sqlserver 2005 求助,高手进,会的人只要一句话就搞定了。 请问此问题如何解决? 数据表初始化问题,谢谢指点?? dbms mss microsoft sql server is not supported in you current installation
from B left join A on a.gx=b.gx and a.date=b.date
where a.gx is null
where not exists (
select 1 from a
where a.gx=b.gx
and a.[date]=b.[date]
)
select * from b where gx not in (select gx from a ) and date not in ( select date from a)