Basically I want to do something like this.
SELECT *
FROM TABLE, (SELECT * FROM TABLE2) SUBQ
WHERE TABLE.SOMETHING IN (SELECT DISTINCT COL FROM SUBQ)
I want to know if it's even possible to call that subquery table in my FROM on another subquery, and if it is, how to do it.
This is a simplified example (my queries are too long), so I'm not looking into another way of rewriting it that doesn't use the subquery in the FROM.