tobeyt23 Posted October 24, 2011 Share Posted October 24, 2011 UPDATE table1 SET deleted = 1 WHERE table1.id IN (SELECT table1.id FROM table1 LEFT JOIN table2 ON table1.table2_id = table2.id WHERE table1.added_by = 948 AND table2.st_abbr = 'CA') Quote Link to comment https://forums.phpfreaks.com/topic/249717-how-can-i-make-this-work/ Share on other sites More sharing options...
Nodral Posted October 24, 2011 Share Posted October 24, 2011 Are you getting any sort of error? What are you trying to acheive? Quote Link to comment https://forums.phpfreaks.com/topic/249717-how-can-i-make-this-work/#findComment-1281800 Share on other sites More sharing options...
ManiacDan Posted October 24, 2011 Share Posted October 24, 2011 JOIN conditions are allowed in an UPDATE. Quote Link to comment https://forums.phpfreaks.com/topic/249717-how-can-i-make-this-work/#findComment-1281835 Share on other sites More sharing options...
tobeyt23 Posted October 24, 2011 Author Share Posted October 24, 2011 Says I can't use table1 in from Quote Link to comment https://forums.phpfreaks.com/topic/249717-how-can-i-make-this-work/#findComment-1281842 Share on other sites More sharing options...
ManiacDan Posted October 24, 2011 Share Posted October 24, 2011 Says I can't use table1 in from Right, because you need to do the JOIN right in the update, not with a subquery. Quote Link to comment https://forums.phpfreaks.com/topic/249717-how-can-i-make-this-work/#findComment-1281899 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.