原因:
不能更新刚select出来的表。
解决方式:
通过中间表。
错误写法:
update tablename set name = 'aaa' where id = (select id from coa_allocplan where id = 'aaa') ;
正确写法:
update tablename set name = 'aaa' where id = (select a.id from (select id from coa_allocplan where id = 'aaa') as a);