UPDATE A SET OF ROWS, USING A SUBQUERY TO SELECT THE ROWS AND TO PROVIDE VALUES

3. Update a set of rows, using a subquery to select the rows and to provide values:

update products

set product_id=(1+(select max(product_id) from products where product_id <> 102))

where product_id=102;

This statement should return the message “1 row updated.”