Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2008
    Posts
    1

    Exclamation Unanswered: Convert UPDATE from Oracle to SQL Server.

    I have this update working in an Oracle database and I need to make it run on SQL Server.

    UPDATE table3 C
    SET C.column1 = 'A'
    WHERE (C.column2, C.column3) IN (SELECT B.column2, B.column3 FROM table1 A, table2 B WHERE A.column2 = B.column2 AND A.column3 = B.column3 AND B.column4 = 1)\

    Help please.

    Thanx!

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    An odd query, but I'll assume it is just an example....
    Here is one method:
    Code:
    UPDATE	c
    SET	column1 = 'A'
    FROM	table3 C
    	inner join table2 B
    		on C.column2 = B.column2
    		and C.column3 = B.column3
    	inner join table1 A
    		on A.column2 = B.column2
    		AND A.column3 = B.column3
    		AND B.column4 = 1
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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