Top "Pivot" questions

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

Dynamic pivot in oracle sql

... pivot (sum(A) for B in (X)) Now B is of datatype varchar2 and X is a string of varchar2 …

sql oracle pivot dynamic-pivot
Pivot in Excel without aggregation, to show text, not numbers?

Let's say I have a table like this: Country Region Mytext USA North a USA South b Brasil North c …

excel pivot pivot-table
Python pandas groupby aggregate on multiple columns, then pivot

In Python, I have a pandas DataFrame similar to the following: Item | shop1 | shop2 | shop3 | Category ------------------------------------ Shoes| 45 | 50 | 53 | Clothes TV | 200 | 300 | 250 | …

python pandas dataframe pivot data-cleaning
Pivot rows to columns without aggregate

Trying to figure how to write a dynamic pivot sql statement. Where TEST_NAME could have up to 12 different values (…

sql pivot
Mysql query to dynamically convert rows to columns

Can MySQL convert columns into rows, dynamically adding as many columns as are needed for the rows. I think my …

mysql sql group-by pivot
How to transform vertical data into horizontal data with SQL?

I have a table "Item" with a number of related items, like so: ID Rel_ID Name RelRank --- ------ …

sql mysql pivot
Example of an Oracle PIVOT clause with subquery

Oracle's definition of the PIVOT clause specifies that there is a possibility to define a subquery in the IN clause. …

sql oracle syntax subquery pivot
I need to know how to create a crosstab query

I need help creating the below results. I thought of a sql pivot but I don't know how to use …

sql pivot crosstab
pandas: how to run a pivot with a multi-index?

I would like to run a pivot on a pandas DataFrame, with the index being two columns, not one. For …

python pandas pivot multi-index
SQL server join tables and pivot

I have two tables with data TABLE 1 --------------------------------------------------- | SALEID | SOLDBY | SALEPRICE | MARGIN | DATE | | 1 | 'aa' | 10,000 | 10 | 2013-1-1 | | 2 | 'bb' | 25,000 | 5 | 2013-5-1 | TABLE 2 …

sql sql-server-2008 join pivot