如果是不同的数据库,两个表怎么样插入 比如数据库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) 求助一条简单的sql语句 大家看看这个sql语句怎么写? 怎样将Mysql数据库从gbk编码转换成utf8? MySQL的存储过程如何让列名做变量 mysql怎样附加自己自动保存的格式的数据库? 问个 mysql 查询的问题,希望会的兄弟可以写完整一些 没插入记录却可以读出来什么情况,自动增长字段被占用 关于mysql远程连接的问题,求救!!! 数据库基本原理原则 是什么? mysql中横表和纵表转换 在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)