например SELECT * FROM (SELECT * FROM table) as inner_tabl
ключевое as можно пропустить
а так:
select
joined_select.*
, main_select.*
from
(select ...) as main_select
inner join ( select …. join ….) as joined_select on joined_select.field=main_select.mfield