关键字是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的环境中试验过。成功。