mysql使用sql语句同步数据

使用sql语句同步源表和目标表的指定地段

INSERT INTO yl_customer_info(customer_name,customer_level,customer_type)


扫描二维码关注公众号,回复: 6551938 查看本文章

SELECT customer_name,customer_level,customer_type


FROM yl_customer_info_copy?



使用IGNORE关键字,如果遇到重复,不会操作当前行

INSERT IGNORE INTO yg_company_info(company_name,tel,company_type,province,city,district,address,ruins_code,ruins_price,price_unit,yyzz_url,create_time,create_user_id,create_user_name)

SELECT company_name,tel,customer_type,province,city,district,address,big_ruins_code,ruins_price,runis_price_unit,certificate1,create_time,create_user_id,create_user_name

FROM yl_customer_info s

WHERE s.register_date BETWEEN '2017-07-31' AND '2017-08-25'

猜你喜欢

转载自www.cnblogs.com/HKROnline-SyncNavigator/p/11056302.html