[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3106
  • Last Modified:

SQL Server Examples of Pivot Tables

Hi
Does anyone know of a site that shows a few examples of SQL Pivot table queries.
I tried W3Schools but couldn't find anything there
0
Murray Brown
Asked:
Murray Brown
2 Solutions
 
Kevin CrossChief Technology OfficerCommented:
You can try Mark and my articles here at EE:

-Dynamic Pivot Procedure for SQL Server
-Pivot Rolling Periods Without Using Dynamic T-SQL
-Broaden Your Horizons : Pivot Again!

The Technet article above is pretty good, though.  You should be able to construct most queries you need from there.  The key to remember is you need a finite, pre-defined list for PIVOT.  If not, you will have to use dynamic SQL.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now