select * from table2 a where not exists
(select 1 from table1 b where a.co1=b.co1 and a.co3=b.co3)
co1 co3
-------------------------------------------------- -------
aac a
adc b(所影响的行数为 2 行)
(select 1 from table1 b where a.co1=b.co1 and a.co3=b.co3)
co1 co3
-------------------------------------------------- -------
aac a
adc b(所影响的行数为 2 行)
解决方案 »
- 求这句case when语句该怎么写?
- 三表交叉查询
- 通过SQL语句如何获取SQLSERVERAgent的实例名
- 怎么我的SOL-SERVER2000服务管理器报这样的错误~
- 作为一个SQL Server 7.0后台管理员,怎么样才能让它更安全?
- VB+SQL多表汇总查询问题,各位老大多多指教
- help!!!数据导入问题
- SQL Server2000 ( select * from table order by No) 其中No是主健,但出来的结果并没有按No排序,其他字段正常,为什么?
- 高分求救-如何在win2k下同时安装sql server 7和2000?
- sql 两个文本框求积?
- @sql 中的 @datetime 问题
- 高难度SQL语句问题~~100分答谢
on a.co1=b.co1 and a.co3=b.co3 where a.co1 is null
结果一样
select * from table2 where co1+co3 not in (select co1+co3 from table1)由于用到了计算,如果数据量大,可能会慢些。