Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Updating one table from another
In article <39172f30_at_news>,
"Patrick Joyal" <please.reply_at_to.the.newsgroup> wrote:
> Try something like this
>
> Update sometable_a a set total_pts = total_pts +
> (Select points_earned from sometable_b b where id = a.id and
> b.date_input = getDate)
Won't that update ALL the rows in sometable_a? I tried something like that on a different set of tables a few days ago, and because there's no WHERE clause on the outer query (only on the subquery), there's no limit on which rows get updated. The subquery, run by itself, gives the result you'd expect, but when you put it in as part of the update, it doesn't work. Unless there's something I'm missing.
Anyway, it's a moot point -- I tried the above on my test tables, and got this error: "ORA-00936: missing expression" regarding the "select" subquery.
--Tina
-- tina_mancuso_at_yahoo.com, tina_at_monster-island.org Sent via Deja.com http://www.deja.com/ Before you buy.Received on Mon May 08 2000 - 00:00:00 CDT
![]() |
![]() |