This command works:
SET @a = '1,2,3,4,5,6,7,8,9';
SELECT Id FROM MyTable2 WHERE find_in_set(Id, @a)
I would like to know if it's possible to use a SELECT instead of '1,2,3,4,5,6,7,8,9' because I wasn't able to do it.
I've tryed:
SET @a = CONCAT_WS(',', (SELECT Id FROM MyTable1 WHERE Id < 10));
but I get error:
Subquery returns more than 1 row
Is there a way to do what I'm trying?