Yup those questions are a stretch for me too! Love that though.
Where are the pivot and unpivot questions?
Where are the pivot and unpivot questions?
Mode's SQL tutorial uses SUM(CASE ...) and CROSS JOIN to mimic pivots: https://mode.com/sql-tutorial/sql-pivot-table/
PostgreSQL can do it via the tablefunc extension and there's `\crosstabview` which is built into psql.
https://www.postgresql.org/docs/current/tablefunc.html
https://www.postgresql.org/docs/12/app-psql.html#APP-PSQL-ME...