Mysql中不能update⾃⾝的解决⽅法不能执⾏:
update der_all_detail
set err_msg='同时存在于wx,zfb平台',proc_time=now()
where order_no in
(
select order_no
from der_all_detail
group by order_no
having count(distinct platform)>1
)
mysql group by order by提⽰:1093 - You can't specify target table 'order_all_detail' for update in FROM clause
>#
解决:再加⼀层⼦查询:
update der_all_detail
set err_msg='同时存在于wx,zfb平台',proc_time=now()
where order_no in
(
select order_no
from (
select order_no
from der_all_detail
group by order_no
having count(distinct platform)>1
) tt
)
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
mysql group rollup 用法
« 上一篇
mysql having的用法
下一篇 »
发表评论