I'm trying to use the result of a custom MySQL function in the WHERE IN clause of a query:
SELECT *
FROM project p
WHERE p.category_id IN (getCategorys(1))
The result of the custom function is as follows:
SELECT getCategorys(1)
1,2,3,4,5
Unfortunately, this does not give the same result as:
SELECT * FROM project p WHERE p.category_id IN (1,2,3,4,5)
The query using the custom function only returns results where category_id = 1
What am I missing here?