mysql update join,insert select 語法

z1340954953發表於2018-03-16

#MySQL更新操作

update table_a m join table_b n
on m.gain_no = n.MOBILE_PHONE
set m.gain_no = n.AIP_NO,m.gain_type = '1'
where m.gain_type = '2' and m.gain_no in (
''
)

#MySQL批量新增

insert into table_a (clo1,clo2,clo3,clo4)
select a,b,c,d from table_b

轉載:http://blog.csdn.net/fansunion/article/details/52130365

相關文章