Author: Rohit Umarjikar
Posted: Thu Dec 15, 2016 2:23 am (GMT 5.5)
I think, you missed to look at my order by.
Your left outer join will give this and not just ABC.
This will come 4 times unless we use DISTINCT.
_________________
Regards,
Rohit Umarjikar
"Knowledge is knowing that a tomato is a fruit, but Wisdom is knowing not to put it in a fruit salad."![icon_razz.gif]()
Posted: Thu Dec 15, 2016 2:23 am (GMT 5.5)
Quote: |
I see your code will give this for Case1: |
I think, you missed to look at my order by.
Quote: |
Let's say an ID=ID1 has the CODEs A,B,C,E,F. Since it has ANY one of the 'valid' IDs, my output will have only these: |
Code: |
ID1 A ID1 B ID1 C ID1 X ID1 X |
Quote: |
Let's say another ID=ID2 has the CODEs E,F,G,H since none of them falls in the list of 'valid' CODEs, so the output will have these: |
This will come 4 times unless we use DISTINCT.
Code: |
ID2 X |
_________________
Regards,
Rohit Umarjikar
"Knowledge is knowing that a tomato is a fruit, but Wisdom is knowing not to put it in a fruit salad."
