Hi there,
Another plain SQL question. I have data that holds entity relationships across years. From it I'd like to know which values of Entity2 have only ever been related to a single Entity1 regardless of the year.
Data looks like the following...
Entity1 Entity2 Year
443 444 1998
4685 4684 1999
4689 4684 1999
8007 16355 2009
8007 16355 2010
8007 16355 2011
8007 16355 2012
363914 37491 2012
146231 37491 2011
363914 37491 2008
363914 37491 2009
363914 37491 2011
146231 37491 2012
363914 37491 2006
363914 37491 2010
I expect 444, 16355 in the result but I just can not figure out how to write the select.
Any insight is much appreciated
DB - Oracle 10G
Thanks
Sean
Another plain SQL question. I have data that holds entity relationships across years. From it I'd like to know which values of Entity2 have only ever been related to a single Entity1 regardless of the year.
Data looks like the following...
Entity1 Entity2 Year
443 444 1998
4685 4684 1999
4689 4684 1999
8007 16355 2009
8007 16355 2010
8007 16355 2011
8007 16355 2012
363914 37491 2012
146231 37491 2011
363914 37491 2008
363914 37491 2009
363914 37491 2011
146231 37491 2012
363914 37491 2006
363914 37491 2010
I expect 444, 16355 in the result but I just can not figure out how to write the select.
Any insight is much appreciated
DB - Oracle 10G
Thanks
Sean