I have a column named relacionados
in the produtos
table and there are some ID's of some items in the produtos
table. I needed to make a explode () or something of the type in the produtos
table and select all products with the ID's that are in this relacionados
table. Was there any possibility? The ID's are separated by , (commas).
Tabela = produtos
Coluna = relacionados
But I do not have to return how many ID's it has. What I need is to return as if it were multiple SELECTS
with the ID's that are in the relacionados
column. For example, in column relacionados
I have: 2,3,5,10
so I needed to do something like this:
SELECT * FROM produtos WHERE id = 2
SELECT * FROM produtos WHERE id = 3
SELECT * FROM produtos WHERE id = 5
SELECT * FROM produtos WHERE id = 10