SQL Language Guide : 8. SQL Statements : UPDATE : UPDATE Examples
 
Share this page                  
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
);