WHERE Clause
The WHERE clause specifies the search_conditions that rows of the table must satisfy in order to be updated.
Caution! Use caution when using the UPDATE statement without a WHERE clause. The target columns are updated for all rows if conditions are not specified using the WHERE clause.
UPDATE Examples
Store order total information at the order level based on detail in the lineitem table.
UPDATE orders o
SET o_totalprice =
( SELECT SUM(l_extendedprice)
FROM lineitem l
WHERE l.l_orderkey = o.o_orderkey
);
Last modified date: 12/12/2024