is it possible to increment the field a and b of a table (A.a and A.b) using the value c and d of a different table (B.c B.d) for all the row of A where A.x == B.z?
I’m getting crazy with this query
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.
DB2 and the SQL standard don’t have a FROM clause in an UPDATE statement.
So you have to clearly separate the steps to
.
Here is an example:
To update two fields you may use an example like this:
The optimizer will see that the sub-queries in the SET and the FROM clause
are identical and it should merge them in the internal execution plan.