Define three average values based on different where conditions:
1 | WITH since_lspay(difference_in_days) as (select difference_in_days from query_6437 where account_create_time > '2021-07-01'), |
a WITH clause defines a temporary data set whose output is available to be referenced in subsequent queries.
Recursive CTE(Common Table Expression)
Recursive CTEs are one of the more advanced functionalities of the WITH clause, which allows referencing itself within that CTE.
The recursive function of the WITH clause similarly incorporates a base case and the recursive step.