So let's say that I have a query:
SELECT `id` FROM `tablename`
This will returns some IDs in rows. Now I want to use these IDs to get data from another table with the 'IN' function.
SELECT `somecol` FROM `anothertable` WHERE `parent` IN ( {IDs here} )
I could do this with PHP using 2 different queries. But I wanted to know how or can it be done with MySQL alone, using only one query?