June 14, 2007 at 9:36 am
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
June 14, 2007 at 10:25 am
Are you getting 2 different result sets when running those as selects?
June 14, 2007 at 10:41 am
I haven't tried it yet.. just wanted to inquire.
June 14, 2007 at 11:14 am
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