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
)

发表评论