首页 > 其他分享 >错误:You can't specify target table 'xxx' for update in FROM clause的解决

错误:You can't specify target table 'xxx' for update in FROM clause的解决

时间:2023-10-20 09:45:14浏览次数:41  
标签:target clause xxx update member usrlogin table id

delete FROM usrlogin where member_id=(SELECT member_id FROM usrlogin WHERE login_id='#011SkhVVje27smbxek0XwjKeA==');

  

会出现报错信息:   You can't specify target table 'tempA' for update in FROM clause   大致意思是,在同一语句中,不能先select出同一表中的某些值,再update这个表。 解决方法:
DELETE FROM usrlogin WHERE member_id=(SELECT a.member_id FROM (SELECT member_id FROM usrlogin WHERE login_id='#011SkhVVje27smbxek0XwjKeA==')AS a );

  

标签:target,clause,xxx,update,member,usrlogin,table,id
From: https://www.cnblogs.com/xjtest/p/17776309.html

相关文章