如果是不同的数据库,两个表怎么样插入 比如数据库A,里面表a 数据库B,里面表b数据库A的表a里面有一并部分name跟表b一样那么怎样去插入那些name不一样的数据高手帮帮忙 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 insert into a.aselect * from b.b as t2 where not exists(select 1 from a.a as t1 where t1.name=t2.name) insert into db2.table2(col1,col2) select fl03,fd09 from db1.table1 where (fl03,fd09) not in (select col1,col2 from db2.table) 当您的问题得到解答后请及时结贴.http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html insert into a values (select * from test.b where test.name not in(select name from a)) 如果不同数据库表a的name列跟表b的username列相同,名字全部对应 表a的birth列一部分为空,空的在表b找得到,想把表b的birth列导入到表a中怎样写? update a set birth = (select birth from db.b where db.b.username=a.name) 额,我自己搞出来了update a.a as t1 sett1.sex=(select t2.sex from b.c as t2 where t1.name=t2.name) 关于MYSQL一个奇怪的编码问题 请教高手,怎么分组查询第三大值? MySQL Cookbook 第2版 中文版 请问 我这句mysql语句 为什么提示错误??? 菜鸟求助:有工具可以将phpmyadmin的数据库的数据表 MySQL数据库图片存取 这样的SQL语句谁会写?? mysql binlog怎么配置只记录单个数据库的操作 character_set_database 始终为latin1,改不掉。 mysql数据库模糊查询like %%的问题 在asp.net中对mysql数据怎样进行时间段查询? 如何解决类似引用多个外键办法?--初学和高手都请进。。。。。。
select * from b.b as t2
where not exists(select 1 from a.a as t1 where t1.name=t2.name)
select fl03,fd09 from db1.table1
where (fl03,fd09) not in (select col1,col2 from db2.table)
http://topic.csdn.net/u/20090501/15/7548d251-aec2-4975-a9bf-ca09a5551ba5.html
表a的name列跟表b的username列相同,名字全部对应
表a的birth列一部分为空,空的在表b找得到,想把表b的birth列导入到表a中
怎样写?
update a.a as t1 set
t1.sex=(select t2.sex from b.c as t2 where t1.name=t2.name)