update demo_table a set (order_id,order_name)= ( select order_id, order_name from demo_order b where a.order_id=b.order_id ) where order_id ='001'; 这个sql语句不难看出,就是从demo_order表中选择适合条件的数据赋给demo_table对应的列,但是对于主查询也需要添加条件。(如果在表中没有定义主键的话主查询中的条件是可以不添加的) 示图如下: 转载于:https://blog.51cto.com/lm1234/891410