Trying to reverse a RIGHT OUTER JOIN statement

  • Are these 2 SQL statementst the same?   (trying to remove a RIGHT OUTER JOIN by reversing the table names and using a LEFT OUT JOIN -- leaving the join criteria and predicates the same)

    UPDATE A SET A.Col_1 = 'ADD' 

     FROM TAB_B B RIGHT OUTER JOIN TAB_A A    

      ON B.Col_2 = A.Col_2    

     AND B.Col_3 = A.Col_3 

      WHERE B.Col_2 IS NULL  

        AND A.Col_4 = 1   

    UPDATE A SET A.Col_1 = 'ADD' 

     FROM TAB_A A LEFT OUTER JOIN TAB_B B    

      ON B.Col_2 = A.Col_2    

     AND B.Col_3 = A.Col_3 

      WHERE B.Col_2 IS NULL  

        AND A.Col_4 = 1   

    BT
  • Are you getting 2 different result sets when running those as selects?

  • I haven't tried it yet.. just wanted to inquire.

    BT
  • I'm sure you'll get a much quicker reply by trying this one out on your own that waiting for us to give it to you.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply