Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Request for new functionality
View staffing
Description
What you would like to accomplish:
See docs here
Rules for pivot_column: A pivot_column must be a constant.
Restricting pivot_column to a constant severely restricts usage and flexibility of this feature.
E.g.
How this might work:
(1)
(2) Alternatively (or additionally) - allow the use of the UNNEST() function in the pivot_column expression.
If applicable, reasons why alternative solutions are not sufficient:
Considered using EXECUTE IMMEDIATE and dynamic SQL but it's too unwieldy and prone to error.
Other information (workarounds you have tried, documentation consulted, etc):
Stack Overflow doesn't provide other solutions, just similar frustrations from other users with this restriction.