SELECT
t1.*
FROM (SELECT *, id FROM ... длинный запрос) AS t1
JOIN (SELECT *, id FROM ... такой же длинный запрос) AS t2
ON t1.id = t2.id
...
SELECT
t1.*
FROM (SELECT *, id FROM ... длинный запрос) AS t1
JOIN t1 AS t2
ON t1.id = t2.id
...