mysql update 多表

示例:

UPDATE  t_contact c, t_header h 
set c.cust_no = h.eu_no 
where c.contract_no = h.contract_no 
and c.contract_type = h.contract_type
and c.company_type=1




update t_contact c 
INNER JOIN t_header h
on c.contract_no = h.contract_no 
and c.contract_type = h.contract_type
and c.company_type=1
set c.cust_no = h.eu_no 

猜你喜欢

转载自blog.csdn.net/tyf07/article/details/78037337