db.l3.ai

Play

lessons

what-changed-in-19

editor

engine: not started

results

Run a query to see rows here.

check

A scalar subquery over a grouping expression

Group bookings by facility_id % 3. The subquery refers to the grouping expression, which PostgreSQL 18 rejected as an ungrouped column.

task

Per group g = facility_id % 3 show g, the name of facility (g + 1) via a scalar subquery, and count(*).

hints