Tanabe Saori
asked on
How do I update 3 columns using multiple selects as expressions
I'm just trying to update three columns based on a backup table.
I'm trying this but it doesn't work. As far as I can tell, it doesn't like something within the (). I've run those separately and they work fine.
Thanks for any help
I'm trying this but it doesn't work. As far as I can tell, it doesn't like something within the (). I've run those separately and they work fine.
update worksheet2
SET `cascade-order` = (select `cascade-order` from worksheet_bak where sid = 56 ORDER BY wid DESC LIMIT 1;),
SET `cascade-name` = (select `cascade-name` from worksheet_bak where sid = 56 ORDER BY wid DESC LIMIT 1;),
SET levels = (select levels from worksheet_bak where sid = 56 ORDER BY `worksheet_bak`.`WID` DESC LIMIT 1;)
WHERE sid = 56 and sub = 'nums';
Right now I'm just trying to do this within phpmyadmin console. Later I'll take the working solution and run it through PHP.Thanks for any help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER