【MySQL】mysql实现将b表某列数据填充到a表
直接上sql:
update order_trace a set a.delivery_time=(select delivery_time from order_express_info b where b.order_id=a.order_id limit 1 ) WHERE 1=1 AND a.delivery_time is NULL #and order_id='2009056564382490' limit 20000;
(一次性可以跑2万条)
子查询的limit 1 是优化查询,必须得带上。