oracle 中有两个表结构相同的表,A,B ,要求把A表中数据全部插入到B表中,我是这样写的, 总是报缺失values 关

我是这样写的
insert into B (B1,B2,B3) select A1,A2,A3 from A;
总是 报缺失values 关键字,这是什么问题求解!!!急啊,插入的数据有50W左右.

第1个回答  2012-04-18
关键字是value,insert into ... select ..from ..是value的。
请检查一下B表的是否有PK、FK、非空字段、唯一索引,不在你写B1、B2、B3之类。
第2个回答  2012-05-22
如果两个表的结构相同,表的字段设置也相同,直接将
insert into b select * from a ;会报duplicate entry 错误
insert into b select * from a where not exists
(select * from b where b.id = a.id);这样会把a中有的数据而b中没有的数据插入到b中
在mysql的环境中试验过。成功。
第3个回答  2012-04-18
你写的内容是没问题啊,实际语句给出来看看。。本回答被提问者采纳
第4个回答  2012-04-18
Select * into B from A
第5个回答  2012-04-18
这段语句看着没有问题啊。

你是在什么地方执行的命令?
sqlplus、pl/sql developer工具?
还是在某种开发语言开发的程序中追问

在DBVisualizer 中执行的。

追答

直接在sqlplus中执行看看

第6个回答  2012-04-18
这句话肯定是没有问题的。
相似回答