Is it possible to store store the result of a request in a variable to use it in a "IN ()" ? I want to do something like that :
SET @v1 := (SELECT id FROM table WHERE id > 10);
SELECT * FROM table WHERE id IN (@v1);
That doesn't work because variables can't store multiple rows. So I tried :
SET @v1 := (SELECT GROUP_CONCAT(id) FROM table WHERE id > 10);
SELECT * FROM table WHERE id IN (@v1);
But that only returns me one result (the first), not all the corresponding IDs. Is there a way to do it ?
~MetalFox Dioxymore