1

Pseudo-code as follows:

update TABLEA a, TABLEB b
set a.addr = 'aaa',
b.name = 'bbb'
from TABLEA a, TABLEB b
where a.id = b.id and a.id = 1
1
  • 1
    Traditional SQL doesn't support multi-table UPDATE; it will likely have to be two statements. Commented Sep 26, 2010 at 4:55

1 Answer 1

4

You can only UPDATE one table. So, you can change your SQL to the following:

UPDATE tableA a
SET a.addr = 'aaa'
WHERE exists
     (SELECT b.id
      FROM tableB b
      WHERE b.id = a.id)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.