SQL Server, Azure SQL Database, Amazon RDS & AWS, Oracle and IBM Help
An online community of DBAs, developers and data intelligence builders, with videos, articles, resources and online events for members and non-members.
Find out more >>
(stewashton) Many folks ask how to do a “dynamic pivot”. It’s often best to use a preliminary query to generate the PIVOT clause. Here’s a generic function to do just that.