Re:SQL Pivot: Converting Rows to Columns
by karkisuni on Thursday November 01, 2018 @01:26PM
(#18356286)
I wish there was something like this in postgres. tablefunc is a lot more complicated than this syntax.
[ Parent
| on HN ]
Re:SQL Pivot: Converting Rows to Columns
by netcraft on Thursday November 01, 2018 @02:44PM
(#18357081)
There are a couple ways to pivot in postgres, here is one that uses json functionality https://gist.github.com/ryanguill/101a19fb6ae6dfb26a01396c53...
Re:SQL Pivot: Converting Rows to Columns
by forkandwait on Thursday November 01, 2018 @01:52PM
(#18356566)
I would like something with simple functionality, where I can just specify the table name, the category column, and the data column and get a new table transposed ibto columns. I would be happy to do the aggregation outside the pivot process. PROC TRANSPOSE in SAS would be a good model.
Re:SQL Pivot: Converting Rows to Columns
by GorgeRonde on Friday November 02, 2018 @09:22AM
(#18362794)
Dynamic row to column pivotation/transpose in Postgres made simple.