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: UPDATE syntax HELP!

Re: UPDATE syntax HELP!

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 03 Dec 1999 13:26:03 -0500
Message-ID: <rm2g4s0832bvvigkuf4470lebsc4u9t7d5@4ax.com>


A copy of this was sent to vmillan_at_dailyherald.com (Vic Millan) (if that email address didn't require changing) On Fri, 03 Dec 1999 16:22:32 GMT, you wrote:

>I have two table, CUSTOMER and CUSADDRESS.
>In the CUSTOMER table, I have a field called ACUSNO.
>Some data in CUSTOMER table has blank ACUSNO.
>I want to populate ACUSNO with a filed in CUSADDRESS called PHONE.
>The key for both tables is CUSNO.
>
>What is the correct syntax when I run UPDATE command??
>
>Vic

update ( select a.acusno, b.phone

           from customer a, cusaddress b
          where a.cusno = b.cusno
            and a.acusno is null )

   set acusno = phone
/

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Dec 03 1999 - 12:26:03 CST

Original text of this message

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