Incident Table
I have Incident Table like below i need to match the client list in client table. How can i do that in oracle ?
INCIDENT_ID |CLIENTS_LIST |
------------|-----------------|
56 |A001##A05M##A0AS |
Client Table
BO_NAME |COMPANYID
----------------------|---------
Test1 |A001
Test2 |A0AS
Test3 |A05M
Test4 |A0BT
Im trying to match the companyid with clients_list but there is no result.
Tried Query
SELECT DISTINCT INCIDENT_ID,
CLIENTS_LIST,
REPLACE(CLIENTS_LIST, '##', ',') AS client_id,
cl.BO_NAME,
COMPANYID
FROM incident ir
INNER JOIN Client cl
ON cl.companyid IN (REPLACE(CLIENTS_LIST, '##', ','))
Expected Output
BO_NAME |COMPANYID
----------------------|---------
Test1 |A001
Test2 |A0AS
Test3 |A05M