mysql与sqlserver不同第一弹

1,两表关联并更新

--sqlserver

update a set a.reg_date = b.reg_data
from gsk_all_to_creditchina a,gsk_re.gsk_new_mysql b
where a.company_name=b.company_name
and a.status not in (2,3,4,‘注销‘,‘吊销‘)

--mysql

UPDATE gsk_all_to_creditchina a
LEFT JOIN
gsk_re.gsk_new_mysql b
ON a.company_name=b.company_name
SET a.reg_date = b.reg_data
WHERE a.status not in (2,3,4,‘注销‘,‘吊销‘)

相关推荐