
建议你查查数据字典,是谁在 *** 作t2表。或者直接重启mysql。
另外你的sql语句看着有些别扭,请改成:
update t2 set t2.birth=(
select t1.birth from t1 where t1.id=t2.id)
要保证t1中的id没有重复就行。
1、忽略表之间的关联关系
ALTER TABLE db2.dbo.table NOCHECK CONSTRAINT 关系名
2、--将没有重复的数据合并
insert into db2.dbo.table(field1,field2...) select field1,field2... from db1.dbo.table a where a.username not in (select username from db2.dbo.table)
3、将重复的数据写入临时表
select field1,field2... into 新的临时表 from db1.dbo.table a where a.username in (select username from db2.dbo.table)
首先问下.你会哪种导入手段.再之.你会哪种导出方法.然后,按你会的 *** 作呗.2个数据库是不是同在本地,还是一个本地一个远程?navicat自带数据导入向导,按那个 *** 作就是.
表名不同没关系.字段不统一的话,要在导入时选下映射关系,不然就只有把远程的表下到本地来.
再用insert
into
目标表(字段1,....字段n)
select
a,b,c,d,...n
from
源表的方式写入.
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)