Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: easy in Access, but not in Oracle (query)

Re: easy in Access, but not in Oracle (query)

From: Mark Styles <lambicm_at_yahoo.com>
Date: Fri, 02 Oct 1998 11:28:42 GMT
Message-ID: <3614b77e.10355550@news.intra.bt.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US