当前位置: 代码迷 >> Informix >> insert into.解决思路
  详细解决方案

insert into.解决思路

热度:6626   发布时间:2013-02-26 00:00:00.0
insert into....
inset   into   taleb1   (field1,field2)   select   field3,field4   from   table2???

这样为什么不支持,那么要怎么写呢,两表结构一样,把表1的数据导到表2中

------解决方案--------------------------------------------------------
inset into taleb1 (field1,field2) select field3,field4 from table2???

怎么没有加values
------解决方案--------------------------------------------------------
insert into t1 select * from t2 两个表的字段要相同
------解决方案--------------------------------------------------------
还有数据类型 要一致
------解决方案--------------------------------------------------------
两个表字段顺序、属性一致的情况下,楼上的办法是简捷可行的
当字段数不同或顺序不同时,楼主的办法也可,但是要注意目标表(table1)中其余字段不能是not null
你的错误可能是把insert 输成inset了
------解决方案--------------------------------------------------------
inset into taleb1 (field1,field2) select field3,field4 from table2

-->

insert into taleb1 (field1,field2) select field3,field4 from table2


你写的inset应该是insert
------解决方案--------------------------------------------------------
inset into taleb1 (field1,field2) select field3,field4 from table2??? 
insert into taleb1 (field1,field2) select field3,field4 from table2
------解决方案--------------------------------------------------------
探讨
inset into taleb1 (field1,field2) select field3,field4 from table2???
insert into taleb1 (field1,field2) select field3,field4 from table2
  相关解决方案