比较难搞的SQL语句 A表和B表,表结构一致,如何把B表中和A表不相同的数据插入A表,这是我的面试题,请大家帮忙想一想。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 方法很多minus就是其中一个insert into a select id,name,addr from aminusselect id,name,addr from b;(语法忘记了 )大致就是这样也可以用外连接 insert into a select id,name,addr from b where not exists(select id from a where a.id=b.id) insert into a select id,name,addr from b where not exists(select id from a where a.id=b.id)正解。取得相同的把not exist改为exist即可 insert into a select id,name,addr from bminusselect id,name,addr from a; insert into Aselect * from A,B where a.id(+)=b.id where a.id is null 求助一个基础的查询 求教 ORACLE初学 oracle 8.1.7 误删除一些表的数据后,如何恢复?求高手解答 为啥我创建不了表? 触发器插入问题 在plsql中,使用绑定变量的方法除了动态sql外,还有别的方式吗 oracle数据库打开问题(在线等待) sql server 与oracle导入数据的问题 高手回答,有关于oracle8的系统问题? 请问:如何在Oracle中实现自增ID,在线等候 比较难搞的sql语句(寻求好的解决方案) 一个简单的select语句编写,在线等待,解决马上给分...
select id,name,addr from a
minus
select id,name,addr from b;(语法忘记了 )大致就是这样也可以用外连接
select id,name,addr from b where not exists(select id from a where a.id=b.id)
select id,name,addr from b where not exists(select id from a where a.id=b.id)
正解。
取得相同的把not exist改为exist即可
select id,name,addr from b
minus
select id,name,addr from a;
select * from A,B where a.id(+)=b.id where a.id is null