首页 > 代码库 > 警惕mysql update的where中使用子查询的陷阱

警惕mysql update的where中使用子查询的陷阱

UPDATE customer_entity
LEFT JOIN sales_order ON customer_entity.entity_id=sales_order.customer_id AND (sales_order.subtotal IS NULL OR sales_order.subtotal=0)
SET customer_entity.group_id = 56
WHERE customer_entity.group_id=1

 

感谢 http://blog.csdn.net/defonds/article/details/46745143

警惕mysql update的where中使用子查询的陷阱