I am trying to pivot a table in Redshift. This answer is instructive: https://stackoverflow.com/a/11751905/3063339 However, when I run the
CREATE EXTENSION tablefunc;
command I get the error:
syntax error at or near "EXTENSION"
Does redShift not support the syntax above, or tablefunc
, or neither? If so, are there any RedShift functions that could act as a workaround? I am aware a table can be pivoted with basic postgresql commands SUM(CASE ...)
etc. These do not scale well for large tables though. Many thanks.