Top "Pivot" questions

The PIVOT syntax converts row data into columnar data, and vice versa for the UNPIVOT syntax.

SQL Server Merge 2 rows into 1

Is it possible to merge 2 rows into a single row in SSRS 2008? Each part will have a record for each …

sql sql-server sql-server-2008 pivot
ORACLE SQL: How do I replace NULL with 0 in a Pivot function

How can I replace NULL with 0 in a PIVOT function on ORACLE SQL? This is the query I'm trying to …

sql oracle pivot null-coalescing
SQL Server PIVOT - Multiple Aggregates

Given the following result set: --------------------------------------------------------- CustomerID  Service  TransType  SubTotal   Tax   NetTotal --------------------------------------------------------- 106           A        CREDIT     12.52   -   12.52 106 A        CREDIT     10.07   -   10.07 106           B        …

sql-server tsql pivot aggregation
What is the opposite of GROUP_CONCAT in MySQL?

I seem to come against this problem a lot, where I have data that's formatted like this: +----+----------------------+ | id | …

mysql csv format pivot group-concat
mysql pivot/crosstab query

Question 1: I have a table with the below structure and data: app_id transaction_id mobile_no node_id customer_…

mysql sql pivot
pandas pivot table rename columns

How to rename columns with multiple levels after pandas pivot operation? Here's some code to generate test data: import pandas …

python pandas pivot pivot-table data-mining
SQL Server pivot vs. multiple join

What is more efficient to use in SQL Server 2005: PIVOT or MULTIPLE JOIN? For example, I got this query using …

sql-server performance sql-server-2005 join pivot
T-SQL Pivot? Possibility of creating table columns from row values

Is it actually possible to rotate a T-SQL (2005) so that (for the sake of argument) the values of the first …

tsql pivot database-table
How to remove multilevel index in pandas pivot table

I have a dataframe as given: df = {'TYPE' : pd.Series(['Advisory','Advisory1','Advisory2','Advisory3']), 'CNTRY' : pd.Series([…

python pandas pivot pivot-table
SQL Server 2012 PIVOT without aggregate

I have the following sample data: Id Name Category ----------------------- 1 Joe A 2 Joe B 3 Joe D 4 Mary A 5 Mary C 6 …

sql-server tsql pivot sql-server-2012