思路是:查出更新时间不同的数据,然后将不同的数据更新或者insert到需要备份的表
sql为:
select c.* from cs_customer c left join kd_customer_backups b on b.id = c.id where ifnull(c.updated_date,0) != ifnull(b.updated_date,0)
表为客户表与金碟客户备份表,使用cs_customer表为主表,比较两张表的更新时间
思路是:查出更新时间不同的数据,然后将不同的数据更新或者insert到需要备份的表
sql为:
select c.* from cs_customer c left join kd_customer_backups b on b.id = c.id where ifnull(c.updated_date,0) != ifnull(b.updated_date,0)
表为客户表与金碟客户备份表,使用cs_customer表为主表,比较两张表的更新时间
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。