Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Posts
    227

    Unanswered: update on 2 tables....

    Hi,
    I've tables AT and AS

    AT:
    ID_A ..............VARCHAR2(64)......PRIMARY KEY
    NAME..............VARCHAR2(64



    AS:
    ID_A...............VARCHAR2(64)......FOREIGN KEY
    NAME...............VARCHAR2(64)


    AT has 2000 records same this:
    ID_A.............................NAME
    10.................................TOM
    20..................................SAM
    30..................................TIM
    40...................................TOM



    AS:
    ID_A...............................NAME
    10...................................TOM
    20...................................
    30...................................
    40...................................TOM



    in AS there are many records null, how can I update this records?

    I tried this but I believe is incorrect:

    update AS
    set NAME=(select NAME from AT where AS.NAME=AT.NAME)
    where AS.NAME is null




    Thanks
    Raf

  2. #2
    Join Date
    Nov 2003
    Location
    Rotterdam, Netherlands
    Posts
    127
    You should be using

    update AS
    set NAME=(select NAME from AT where AS.id_a=AT.id_a)
    where AS.NAME is null

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •