update <表名> set (<列名>,<列名>...)=( select <列名>,<列名>... from <表名> where <条件> ) where <条件>正如beckhambobo(beckham) 说的,SET语句的返回值必须唯一
update 表A set A.amount= (select H.F from H where A.emp_id=H.G ) where A.emp_id=H.G //H由多个表中的字段合成的,这里报 // invalid column name的错误 and A.item_id='9999' and A.pay_id='11'
set (<列名>,<列名>...)=(
select <列名>,<列名>...
from <表名>
where <条件>
)
where <条件>正如beckhambobo(beckham) 说的,SET语句的返回值必须唯一
(select H.F from H
where A.emp_id=H.G
)
where A.emp_id=H.G //H由多个表中的字段合成的,这里报
// invalid column name的错误
and A.item_id='9999'
and A.pay_id='11'