1. 18
  1.  

  2. 4

    It’s only a single SELECT statement if you don’t count the SELECT statements used in the CTEs (common table expressions) and the SELECT statements used for subqueries in the WHERE clause. It’s a cool implementation despite the misleading title.

    1. 11

      Eh; it is, to the letter of the law, a single SQL statement. I think it’s impressive, and have no qualms calling it a single statement.