I have 2 tables, TARGETLIST and ACCOUNT_MANAGER as follows
For all the CUSTOMERIDs in TARGETLIST, I am trying to find out the ACCTMGRIDs from ACCOUNT_MANAGER in a comma separted string
The data conditions are
1. There can be one or more ACCTMGRIDs per CUSTOMERID in the ACCOUNT_MANAGER table. 2. Not all the CUSTOMERIDs from TARGETLIST will be in the ACCOUNT_MANAGER table. 3. The TARGETLIST table may have multiple rows with the same CUSTOMERID
So, the final result should ideally look like this:
Here's the query I came up with, but its not working .