Who can help me solve this issue?
I have table A with a column with id's. A row can be empty or has one or more id's. If there are more id's in a row then they are comma seperated:
5f7c4738dcf5d
5f8571d05cffb,5f8574dc6a681,5f99d6d30b3ad
null
5f8ff7f6514ef,5f8fd1eac16a7
In table B I have also id's. But just one id per row.
Now I want to select all the rows in table B if the same id does not exist in table A.
I tried this query:
SELECT *
FROM B
WHERE NOT EXISTS (SELECT ids FROM A WHERE A.ids LIKE '%B.id%')
If i use the = operator (instead of LIKE) then it works but the comma seperated values are not selected.
How can I compare the comma separated values?