0
UPDATE A,B SET A.a = 'something' WHERE A.b = B.b AND A.c = B.C; 

I have this code inside a function in sql, but it doesn't work. I fill table B inside the function but first of all when I want to use it in the update above I get an Error like FROM Clause-B or something. And secondly a get an error for the comma next to A. What can I do instead of the code above? Does anybody knows where the problem is?

3
  • 1
    You can not use multiple table names after UPDATE keyword. You can only update 1 table. If you are trying to join, you can not join like that. Please provide the A,B table structure and give more details. Commented May 13, 2015 at 23:17
  • 1
    In addition to @Orchun's excellent suggestion, please post the full actual error instead of a haphazard guess. Commented May 13, 2015 at 23:18
  • You are essentially asking: How to do an update + join in PostgreSQL? I'm voting to close your question as a duplicate of that one. Commented May 13, 2015 at 23:28

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.