What is Pivot in sql server ?

Posted by Kk86kiran under Sql Server on 4/17/2012 | Points: 10 | Views : 15537 | Status : [Member] | Replies : 8
What is Pivot in sql server and how it will be useful to us?

k.m.j.kiran


Responses

Posted by: Sakthi.Singaravel on: 4/17/2012 [Member] Silver | Points: 25

Up
0
Down
Hi,

A pivot table is a program tool that allows you to reorganize and summarize selected columns and rows of data in a spreadsheet or database table to obtain a desired report. A pivot table doesn't actually change the spreadsheet or database itself.

Regards,
Singaravel M

Kk86kiran, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/17/2012 [Member] Silver | Points: 25

Up
0
Down
For example, see this link..

http://blog.sqlauthority.com/2008/06/07/sql-server-pivot-and-unpivot-table-examples/

Regards,
Singaravel M

Kk86kiran, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/17/2012 [Member] Silver | Points: 25

Up
0
Down
A Pivot Table can automatically sort, count, and total the data stored in one table or spreadsheet and create a second table displaying the summarized data. The PIVOT operator turns the values of a specified column into column names, effectively rotating a table.



Regards,
Singaravel M

Kk86kiran, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 6/19/2012 [Member] Bronze | Points: 25

Up
0
Down
PIVOT rotates a table-valued expression by turning the unique values from one column in the expression into multiple columns in the output, and performs aggregations where they are required on any remaining column values that are wanted in the final output.
Refer this link
http://msdn.microsoft.com/en-us/library/ms177410(v=sql.105).aspx

Kk86kiran, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ravianand on: 6/19/2012 [Member] Starter | Points: 25

Up
0
Down
Refer Below Link...

http://www.mssqltips.com/sqlservertip/1019/crosstab-queries-using-pivot-in-sql-server-2005/

Regards,
Ravi

Kk86kiran, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ravirajch on: 3/9/2013 [Member] Starter | Points: 25

Up
0
Down
We use pivot queries when we need to transform data from row-level to columnar data.

Pivot query help us to generate an interactive table that quickly combines and compares large amounts of data. We can rotate its rows and columns to see different summaries of the source data, and we can display the details for areas of interest at a glance. It also help us to generate Multidimensional reporting.

Please refer below mentioned URL for understanding functionality.
http://blogs.msdn.com/b/spike/archive/2009/03/03/pivot-tables-in-sql-server-a-simple-sample.aspx


Kk86kiran, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raj.Trivedi on: 3/9/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hello kk86kiran

Please check this video

https://www.youtube.com/watch?v=XBTYnrl4-ZY

Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved

Kk86kiran, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response