ORDER BY coalesce(x, 0): there is no x (opens in new tab)
I was reading Markus Winand’s latest post on ORDER BY history last week. If you haven’t read it yet, go read it. Markus is one of the best writers on SQL standards, and this post is no exception. One line stopped me cold. The compatibility table for “expressions on selected columns.” Postgres: partial. PostgreSQL 18: still partial. That itch needed scratching. What the standard says 🔗SQL:1999 lifted a restriction from the original ORDER BY clause.
Read the original article