I've created a (complex) sub-query where I put the results in a variable like:
@mylist := (select .... )
The returned value is a comma-delimeted string.. Because in the sub-query I also use concat(), the value is a string.
In the same SQL I want to use this variable in another subquery like:
where table.mycolumn IN (@mylist)
The problem is that because @mylist is a string Mysql reads the query as:
where table.mycolumn IN('575030,655156,655157')
while I want it to be execute as
where table.mycolumn IN(575030,655156,655157)
How can I convert the string to an (numeric) array?
PS: I am using mysql 5.1