有两个表a.db,b.db,它们的字段名都是一样子的。但是顺序不一样子,(字段名称还很多,我没有列出来)
a
formno,ttime,customerno,name,sale
b
formno,customerno,name,sale,ttime
ttime @类型,sale 数字类弄,其它字段类型也不一致;
现在执行
insert into a (formno,ttime,customerno,name,sale)
select formno,ttime,customerno,name,sale from b
还是不成功,提示类型不一致;
该用那条语才可以插入成功
或者你试一下复制一个a表为c,在试试出不出错
select formno,ttime,customerno,name,sale from b来插入数据...还是改为类型一致才行..
a
formno,ttime,customerno,name,sale
b
formno,customerno,name,sale,ttime
~我要在不用手工改变(即用DATABASE DESKTOP 打开 b 表,把字段顺序改为 formno,ttime,customerno,name,sale 跟a表一致,在这种情况下就可以插入成功 )
因为我每天都要执行这个插入动作!~不可能每次都手工去改动 b 表字段顺序.
select formno,ttime,customerno,name,sale into a from b
那么 你的 insert into 语句完全正确,可以插入的.
仔细检查一下