Tim Gornall wrote:
Thanks Joe! What is "CTE"?
Just in case you didn't catch Eric's excellent post, a common table
expression is the "with t1 as..." syntax that basically allows you to
define one or more temporary derived tables and then use those in a
further expression. It's hugely powerful.
Joe