In a table, there is a column that contains ids separated by comas ex: "159,167"
I want to do the equivalent of a join between this table and the table that contains those ids.
ex:
TableA TableB
id desc id desc tableAids stock
1 test1 1 abc 1,2,3 1
2 test2 2 def 1,2 0
3 test3 3 ghi 3,4 10
4 test4
How can I join the two tables with a query? I explored the function group_concat() but it returns a string wich I cannot put in a IN clause.
What I am trying to do is something like this:
Select a.desc from TableA a
LEFT JOIN TableB b on a.id = b.tableAids
WHERE b.stock > 1