如何从两张数据表中找出其中一张表中不存在的数据 select * from key not in (select a.key from table1 a join table2 bon a.code=b.code and a.spec =b.spec) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不号意思,法错了。改改select * from table1 key not in (select a.key from table1 a join table2 bon a.code=b.code and a.spec =b.spec) select * from table1 where key not in (select a.key from table1 a join table2 bon a.code=b.code and a.spec =b.spec) select a.* from table1 aleft join table2 b on a.code = b.code and a.spec = b.specwhere b.code is null or b.spec is null select * from table1 where key not in (select table2.key from table2 where table2.code=table1.code and table2.spec=table1.spec) select * from table1 a where not exists ( select * from table2 b where a.code=b.code and a.spec=b.spec ) sql双重循环的问题 SQL SERVER过程中传一个字符串参数 问题 行列互转语句 !!!XP中没有Microsoft Search服务,可以用全文索引功能吗? 各位大哥帮我解决哈,这怎么做? |zyciis| 一个关联到两个数据库进行查询的问题 大家看一下怎么样的效率会更好 谢谢 执行运行时候出错`` sql面试遇到的一个问题. 大家誰知道在SQL Server裡中文怎麼可以按照筆畫來排序? 关于Oracle8i TNSListener的问题? 哪位老大能不能介绍一下:在因特网上利用SQL server2000进行数据复制方面的文章? 这几条sql语句怎么用??
select * from table1 key not in (select a.key from table1 a join table2 b
on a.code=b.code and a.spec =b.spec)
on a.code=b.code and a.spec =b.spec)
left join table2 b on a.code = b.code and a.spec = b.spec
where b.code is null or b.spec is null
where not exists
(
select * from table2 b
where a.code=b.code and a.spec=b.spec
)