I would like to \"declare\" what are effectively multiple TEMP tables using the WITH statement.
The query I am trying to execute is along the lines of:
You can also chain your results using WITH statement.
Eg:
WITH tab1 as (Your SQL statement),
tab2 as ( SELECT ... FROM tab1 WHERE your filter),
tab3 as ( SELECT ... FROM tab2 WHERE your filter)
SELECT * FROM tab3;