I think you need something like:
SELECT * FROM table WHERE id IN (SELECT id FROM table2);
I don't understand what your non-working subquery is trying to do, it seems like you could just tell SELECT id FROM table
because its currently invalid SQL92 syntax.
source
to share