select * from ( select ... from table1, table2 where ... ) where ...