Azu Posted August 21, 2007 Share Posted August 21, 2007 Hi, can somebody please tell me how to fix my query? update `Table` set `PreviousID`=(select `ID` from `Table` where `NextID`=`Table`.`ID`) For some reason it is giving me this weird error; Error Code : 1093 You can't specify target table 'Table' for update in FROM clause Quote Link to comment Share on other sites More sharing options...
Illusion Posted August 21, 2007 Share Posted August 21, 2007 you cannot update a table and select from the same table in a subquery, MySQL currently not suppoprting that. Quote Link to comment Share on other sites More sharing options...
Azu Posted August 21, 2007 Author Share Posted August 21, 2007 Okay.. please show me the right way to do this then.. I'm new to subqueries :-/ Quote Link to comment Share on other sites More sharing options...
Illusion Posted August 21, 2007 Share Posted August 21, 2007 create a temporary table and go ahead............ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.