Hi,
I have a situation in oracle where I have two tables - Table A and Table B.
Table A has the following columns (aid, owner_id, app_id) and
Table B has the following columns (bid, aid, emp_no)
Table B has a foreign key (aid) back to Table A.
Based on the above tables, I am trying to write a query where an emp_no in Table B belongs to more than one owner_id in Table A.
The rule of thumb is that an emp_no can only belong to just one owner_id.
Currently I have a data issues where one emp_no belongs to more than one owner_id.
For example:
I have a situation where emp_no belongs to 2 or more owner_ids - it is these records that I need to retrieve back but unsure how to.
Information I would like to retrieve is:
emp_no and owner_id
Any help with query would be appreciated using Oracle sql.
Thanks.