Hello!
I'm hoping someone's got a SQL snippet already lying around that can help me locate these problem accounts. We've been merging our way through a bunch of duplicates, and somewhere along the way, a number of individual accounts got merged but the households attached to them did not. So now, I have individuals attached to multiple (duplicate) households.
Example attached.
I'm looking for a query that will help me pinpoint these accounts - listing the ID of the individual who's connected to 2+ households - that will not also include with it all the other affiliations an individual may have.
Also curious - has anyone else ever run into this?
Hi Stacey,
This should do the trick:
select a.individual_customer_no from T_AFFILIATION ajoin T_AFFILIATION b on a.individual_customer_no = b.individual_customer_nowhere a.affiliation_type_id = 10002 and b.affiliation_type_id = 10002and a.group_customer_no <> b.group_customer_no
Cheers,
Rachel
Thanks, Rachel! That was perfect.
I was totally over-thinking it :)