Db2 sql update statement

broken image
broken image

Let’s say we had a table of products that looked like this: PRODUCT_ID The first method we will look at is using a subquery in the SET clause of an UPDATE statement. There are several different ways to use subqueries in UPDATE statements. They are often used in SELECT and UPDATE statements to make these queries more efficient and easier to maintain.

A subquery is a powerful way to find the data you want to use for another query.

broken image