表table1与表table2都有个字段NUM,例如 表1的num字段:a1至-a200(共200个记录) 表2的num字段:a2,a3,a7...a101(不规则的70个记录),我现在想要是表1与表2对比扣除相同的记录值(表1还有130个与表2不同的记录)如何做到,最好有例子,谢谢.....
解决方案 »
- 求技术支持 delphi中string还原到TStream大小不一样
- 【散分】发布函数代码查询器 FunSearcher v1.0.0
- 如何实时监控进程的创建和销毁?
- DLL全局钩子问题,高手帮我看看
- intraweb里的jscript和delphi代码之间变量传递的问题
- listView 与treeview搭配使用的问题
- 学过VB,刚接触delphi,关于代码的事情。
- 请帮忙解惑SearchRec.Attr and faDirectory 虽然问题比较菜,但对我很重要啊。谢谢
- 大哥們不要暈倒,菜鳥再次提問:
- 怎样制作专用的文件查看工具?请指教!
- 新手,一个基础问题?
- 400帮忙调试一个小问题,愿意的加qq13402043,另外的分数另外开帖送
'select 表1.Num from 表1 where 表1.Num not in ('select 表2.Num from 表2)'
delete from 表1 a where exists (select 1 from 表2 b where a.Num = b.Num)
where not exists(select * from t_b where t_a.num=t_b.num)
order by num
/
select a.* from 表1 a where not exists (select 1 from 表2 b where a.Num = b.Num)