I have a table X which has y as column
x.y values are basically strings seperated by comma for example
X.y = hello,world
now I have another table A which has columns id and b
id b
1 hello
2 world
Now, I am writing a query:
SELECT
(SELECT count(id) FROM A
where b IN (CONCAT("'",REPLACE(X.y,"'","','"),"'"))) as aCount
FROM X
It is showing me zero whereas it should show 2 because
CONCAT("'",REPLACE(X.y,"'","','"),"'")
could be 'hello','world'