错误方式
update 表名 set(字段1,字段2,字段3) = (select 数值1,数值2,数值3 from 表名 where....) where 条件 百度写的,原因可能是不支持更新表的同时,在子查询表中连接表(有博客这么写)
解决方法
update 表名 别名A,(select 字段名1,字段名2 from 表 where 条件) 别名B set
A.字段1 = B.字段1,A.字段2 = B.字段2 where 条件
错误方式
update 表名 set(字段1,字段2,字段3) = (select 数值1,数值2,数值3 from 表名 where....) where 条件 百度写的,原因可能是不支持更新表的同时,在子查询表中连接表(有博客这么写)
解决方法
update 表名 别名A,(select 字段名1,字段名2 from 表 where 条件) 别名B set
A.字段1 = B.字段1,A.字段2 = B.字段2 where 条件