logoalt Hacker News

tn1yesterday at 7:24 AM1 replyview on HN

DuckDB and Microsoft Access (!) have a PIVOT keyword (possibly others too). The latter is of course limited but the former is pretty robust - I've been able to use it for all I've needed.


Replies

amichalyesterday at 11:58 AM

PostgresSQL

"crosstab ( source_sql text, category_sql text ) → setof record"

https://www.postgresql.org/docs/current/tablefunc.html

VIA https://www.beekeeperstudio.io/blog/how-to-pivot-in-postgres... as a current googlable reference/guide