Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
12. Summary


Good job! This query was really challenging!

It's time to wrap things up.

  • It's impossible to put a CTE inside another CTE. However, each CTE might use previously defined CTEs in the FROM clause.
  • Nested CTEs might be used to compute aggregate functions on a few levels.
  • If you need more than just the aggregate result in the outer query, you can use a small subquery.
  • CTEs can also be used to compare two (or more) groups of rows.

Are you ready for a short quiz, then?


Press Next exercise to continue.