Table A joins to TABLE B on an ID. The problem I'm finding is that sometimes in table A, the returned column for ID is multiple ID's Separated by a comma. So what I'm trying to do is just to a join based on the 1st id in the CSV list.
SELECT ID, name
FROM TableA a
INNER JOIN TabelB b ON b.id = a.id
Also, please note that the ID's in both tables aren't primary key's. They are just named like that.
Here's what the content looks like in table A/B
Table A
ID           Name
10023,2019   Bob
1243         Mary
29853        William
Table B
Company      ID
Kroc         10023
Espres       99378
MarcDonalds  10023
etc...
In the supplied example data, only Kroc should come up with Bob. Even though there are 2 results in table B, just ignore and return 1.
 
     
     
    