I keep a hard list
SELECT @items := GROUP_CONCAT(ID) FROM table_1 ... etc
@items is now a string of numbers: 55.77.99,2038.2844, etc.
Later I will try to use it in the where clause as such:
SELECT * FROM table_2 WHERE table_1.ID IN (@items)
This does not work. It seems like it should. I know when I manually pull out the data, put it in a variable, and then output it:
list($x) = SELECT @items := GROUP_CONCAT(ID) FROM table_1 ... etc $goodResults = SELECT * FROM table_2 WHERE table_1.ID IN ($x)
Any ideas? Thanks.
source share