UPDATE table1, tmpList
SET table1.ts = tmpList.ts_value
WHERE table1.id = tmpList.id
UPDATE table2, tmpList
SET table2.ts = tmpList.ts_value
WHERE table2.id = tmpList.id
I’m using MySQL
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.
Assuming every id appears in both tables (ideally only once):
Update: simply using left joins instead of inner joins makes this work even for ids that are only in one table – the inapplicable set clause seems to just be skipped; I should have tried it earlier, apparently.