Is this possible in mysql?
update table1
set column1 = (select column1 from table2
inner join table3
where table2.column5 = table3.column6);
Here is a a similar question for an Oracle DB.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do it. However, in the example you give, there’s no JOIN connection between table1 and the source of the values for the update (table2 INNER JOIN table3), so the results will be somewhat unpredictable.
Your query would be something like (I’m not a MySQL expert):
but what I think you probably want (I’m just guessing) is something more like: