What is the difference between a CTE and a subquery?

Technical