标签:ati insert 另一个 mysql count _id left join where bak
update a left join c on a.id = c.id set a.body = c.c1 where a.id=c.id;
update zcat as z left join zcat_bak_1212 as zb on z.zcatId = zb.zcatId set z.zcatName = zb.zcatName where z.zcatName is null;
我用到的如下
update z_vnetid__money a left join tab_feeaccount b on a.C_VNETID = b.c_accountcode set a.i_id = b.i_id where a.C_VNETID = b.c_accountcode;
1. 表结构完全一样
insert into 表1
select * from 表2
2. 表结构不一样(这种情况下得指定列名)
insert into 表1 (列名1,列名2,列名3)
select 列1,列2,列3 from 表2
3、只从另外一个表取部分值
insert into 表1 (列名1,列名2,列名3) values(列1,列2,(select 列3 from 表2));
标签:ati insert 另一个 mysql count _id left join where bak
原文地址:http://www.cnblogs.com/nmap/p/6720357.html