sql WITH - ghdrako/doc_snipets GitHub Wiki

WITH query_name (column_name1, ...) AS
     (SELECT ...)
SELECT ...

WITH query_name1 AS (
     SELECT ...
     )
   , query_name2 AS (
     SELECT ...
       FROM query_name1
        ...
     )
SELECT ...