标签:mysq back ... 更新 order master mysql 举例 nbsp
mysql数据库在批量更新某表的字段时,语法如下:
UPDATE A AS a
INNER JOIN (
SELECT
*
FROM
A
WHERE
....
) AS b ON a.order_id = b.order_id
SET a.pay_status = 2 ,a.abnormal = 4;
举例:
UPDATE Yamibuy_Master.xysc_order_info AS oi
INNER JOIN (
SELECT
order_id,order_sn,pay_status,abnormal
FROM
Yamibuy_Master.xysc_order_info
WHERE
abnormal = !4
AND order_status = 1
AND shipping_status = 0
AND pay_status = 0
AND warehouse_number = 002
) AS A ON oi.order_id = A.order_id
SET oi.pay_status = 2 , oi.abnormal = 4;
标签:mysq back ... 更新 order master mysql 举例 nbsp
原文地址:http://www.cnblogs.com/phoebe1202/p/7417726.html