Re:The SQL filter clause: selective aggregates
by Xophmeister on Monday May 30, 2016 @09:24AM
(#11801187)
I personally find CTEs much easier to read than subqueries.
[ Parent
| on HN ]
and you can use them in multiple places. I'm not sure if you have the same subquery twice if the query optimizer uses a single dataset.