mysql使用另外表的字段值来更新原来表

UPDATE crm_agentbeauty t1,crm_agent t2 SET t1.area_m=t2.area_m WHERE t1.`uperid`=t2.`id`

UPDATE crm_agentbeauty t1,per_employe t2 SET t1.brand_m=t2.employeName WHERE t1.`brand_m`=t2.`login`

UPDATE crm_agentbeauty t1,per_employe t2 SET t1.producer=t2.employeName WHERE t1.`producer`=t2.`employeId`

UPDATE crm_agent t1,per_employe t2 SET t1.modifier=t2.employeName WHERE t1.`modifier`=t2.`employeId`

UPDATE crm_agent t1,per_employe t2 SET t1.approver=t2.employeName WHERE t1.`approver`=t2.`employeId`

UPDATE crm_agentbeauty t1,per_employe t2 SET t1.modifier=t2.employeName WHERE t1.`modifier`=t2.`employeId`

UPDATE crm_agentbeauty t1,per_employe t2 SET t1.approver=t2.employeName WHERE t1.`approver`=t2.`employeId`

分享:

发表评论

电子邮件地址不会被公开。 必填项已用*标注

😉😐😡😈🙂😯🙁🙄😛😳😮:mrgreen:😆💡😀👿😥😎😕