tldr: Examples of CTE vs. temp table query where temp tables perform much better than CTEs. See the query examples at the end of the post. caveat: I'm not saying CTEs are bad, they have their place, but different situations require different solutions.…