http://the-stickman.com/uncategorized/mysql-update-with-select-on-the-same-table-in-the-same-query/
update euser set `parentID` = (SELECT user_id from (SELECT `user_id` FROM euser WHERE `usernameid` = `usrname`) as userid ) - not working
http://www.daniweb.com/web-development/databases/mysql/threads/300670
this works:
update euser inner join euser2 on euser.`usernameid`=euser2.usrname set euser.`parentID` = euser2.user_id
No comments:
Post a Comment