Results 1 to 2 of 2

Thread: UPDATE query ?

  1. #1
    Join Date
    Mar 2004
    Posts
    205

    Unanswered: UPDATE query ?

    Hi,

    The below is a SQL Server query :

    UPDATE (table1 INNER JOIN table2 ON table1.sno = table2.sno1) INNER JOIN table3 ON table2.sno = table3.sno1 set name = 'dffg'

    Please give the Oracle equivalent for the above.

    Thanks,
    Sam

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    It is ambiguous as to which table you are updating here (which table has a column called "name") - but I'm guessing it is TABLE1:
    Code:
    UPDATE table1
    SET name = 'dffg'
    WHERE table1.sno IN
    ( SELECT table2.sno
      FROM table2 
      INNER JOIN table3 ON table2.sno = table3.sno1
    );
    Alternatively, if table1 is the one and only "key-preserved" table in that query, then this should work:
    Code:
    UPDATE
    ( SELECT name 
      FROM   table1
      INNER JOIN table2 ON table1.sno = table2.sno1
      INNER JOIN table3 ON table2.sno = table3.sno1 
    )
    set name = 'dffg';

Posting Permissions

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