UPDATE titles
SET ytd_sales = t.ytd_sales + s.qty
FROM titles t, sales s
WHERE t.title_id = s.title_id
AND s.ord_date = (SELECT MAX(sales.ord_date) FROM sales)
The above sql works on sqlserver, refer to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ua-uz_82n9.asp.
But it does not work on oracle. Oracle, we have to use the sql like following:
UPDATE a
SET (aa) = (SELECT bb FROM b
where a.cc=b.cc);