A common table expression (WITH name AS (…)) lets you write a query in readable steps. It is mostly about clarity; it does not change the result.