1. 程式人生 > >mysql 將A表中的資料更新到B表中

mysql 將A表中的資料更新到B表中

UPDATE table_a t1 INNER JOIN (     SELECT         *     FROM         table_b tt     WHERE         tt.order_info_id IN (             SELECT DISTINCT                 order_info_id             FROM                 table_a         ) ) t2 ON t1.order_info_id = t2.order_info_id SET   t1.order_create_time = t2.create_time,  t1.order_begin_time = t2.begin_date,  t1.order_end_time = t2.end_date;