mysql中不支持嵌套查询后更新操作。
但是可以使用inner join来解决自身的更新问题,参考如下例子:
update hera_job a inner join( select id,concat(‘su - hadoop -c "source /etc/profile && ‘,substr(script,3),‘"‘) as script_new from hera_job ) b set a.script = b.script_new where substr(a.script,1,2) = ‘sh‘ and a.id = b.id
原文:https://www.cnblogs.com/30go/p/10554055.html