Solved

SQL Server Examples of Pivot Tables

Posted on 2014-01-23
2
2,754 Views
Last Modified: 2014-01-26
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
Comment
Question by:murbro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
Surendra Nath earned 250 total points
ID: 39803943
0
 
LVL 60

Assisted Solution

by:Kevin Cross
Kevin Cross earned 250 total points
ID: 39804096
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question