7 ms·
I wish there was something like this in postgres. tablefunc is a lot more complicated than this syntax.
by karkisuni 8y ago
I wish there was something like this in postgres. tablefunc is a lot more complicated than this syntax.
- forkandwait 8y agoI 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.
- netcraft 8y agoThere are a couple ways to pivot in postgres, here is one that uses json functionality https://gist.github.com/ryanguill/101a19fb6ae6dfb26a01396c53fd3c66 https://gist.github.com/ryanguill/101a19fb6ae6dfb26a01396c53...
- GorgeRonde 8y agoDynamic row to column pivotation/transpose in Postgres made simple. https://github.com/hnsl/colpivot https://github.com/hnsl/colpivot