mysql中 對同一個表先查詢後刪除時報錯,怎麼破的問題

1.mysql中 對同一個表先查詢後修改時報錯,怎麼破的問題:

 

update c set name='ju' where id in(




select id from c where id=3


)

 

 

2.在sql查詢外面嵌套一個sql查詢:

update c set name='ju' where id in(


select id from (
select id from c where id=3
) as p
)

3.重新查看結果:

 

2.mysql中對同一個表先查詢後修改時報錯,怎麼破的問題:

delete from enterprise_base_info   where  id in (
select id from (
select id  from  bocportal.enterprise_base_info 
where (stock_code='' or company_abbreviation='')  and  syncStatus=9 ) as a
)

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章