Equivalent to unpivot() in PostgreSQL
Create an example table: CREATE TEMP TABLE foo (id int, a text, b text, c text); INSERT INTO foo VALUES (1, ‘ant’, ‘cat’, ‘chimp’), (2, ‘grape’, ‘mint’, ‘basil’); You can ‘unpivot’ or ‘uncrosstab’ using UNION ALL: SELECT id, ‘a’ AS colname, a AS thing FROM foo UNION ALL SELECT id, ‘b’ AS colname, b AS … Read more