Great example on how to pivot multiple columns and aggregates them and then continues by then doing it with a dynamic pivot. Also example is showing off a great tool called SQL Fiddle created by Jake Feasel.
- pivot multiple columns – SQL Fiddle with Demo
- pivot multiple columns using dynamic pivot – SQL Fiddle with Demo
- SQL Fiddle : SQL Online Practice Tool – You Tube