WITH name1 AS (SELECT ...), name2 AS (SELECT ...) SELECT... FROM name1, name2, whatever ...
This solves a major problem with the SQL statements, especially for self-joins on such pre-computed data, and lets you do fork-and-join in a single statement. I'm surprised that it wasn't used all over the place for the CEP systems.