1.关联删除
删除表t1已经在表t2中存在的数据:
DELETE t1 FROM table_1 t1, table_2 t2 WHERE t1.id=t2.id and t1.year=t2.year and t1.month=t2.month;
2.关联更新
update xcs_user_credit_score a1,xcs_user_credit_score a2 set a1.user_currday_score=a1.user_currday_increment_score+a2.user_currday_score where a1.pt_day='2017-09-20' and a2.pt_day='2017-09-19' and a1.uid=a2.uid;
浙公网安备 33010602011771号