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

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL help needed

Re: SQL help needed

From: Happy <allan_at_livvy80.freeserve.co.uk>
Date: Wed, 31 Jan 2001 21:37:14 -0000
Message-ID: <95a0mq$jv0$1@newsg1.svr.pol.co.uk>

UPDATE a SET city =

    (SELECT b.city
    FROM b
    WHERE b.personnr = a.personnr)
WHERE EXISTS
    (SELECT 'x'
    FROM b
    WHERE b.personnr = a.personnr)

Cheers
Allan

"Gert Ensing" <g.c.ensing_at_castel.nl> wrote in message news:959jjb$th0$1_at_news.castel.nl...
> I have to tables :
>
> Table A and table B
>
> A
> =
> Personnr
> Name
> City
>
> B
> =
> Personnr
> City
>
> I like to fill A.City with B.city for all records in A where the
 personnr's
> are equal.
>
> In MS-Access I use the statement :
>
> UPDATE A INNER JOIN B ON [a].[personnr]=[b].[personnr] SET a.city=b.city
>
> but this doesn't work in Oracle.
>
> Please help ! (Send me an email to : g.c.ensing_at_castel.nl)
>
> Thanks in advance,
> Gert
>
>
Received on Wed Jan 31 2001 - 15:37:14 CST

Original text of this message

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