Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: easy in Access, but not in Oracle (query)
Fri, 02 Oct 1998 06:31:41 -0400, Kevin Kirkpatrick <kjk_at_hrb.com>
rambled:
>I have what will probably be an easy question to answer. Yesterday I
>needed to update a table based on another table. Something like:
>
>table1 table2
>
>id id
>name address
>address
>
>What I was trying to do is move the address field of table2 into the
>address field of table1. For some reason I wasn't able to do it in
>oracle. I linked up to the database thru MS-Access and was able to do
>it with Access. So, that kinda says that it can be done, but when I
>used a similar sql query in oracle (same as the one MSAccess produced,
>it still did not work. What would be the format for the UPDATE? A
I would guess at:
UPDATE table1
SET address =
(select address from table2 where table1.id = table2.id);
this assumes that id is a primary key and therefore unique in both tables.
Mark Styles
Spam my account, lose your account. Clear enough?
Religious tolerance is an oxymoron.
Received on Fri Oct 02 1998 - 06:28:42 CDT