Top "Unpivot" questions

UNPIVOT describes a Query Language feature of some Relational Databases.

SQL Unpivot multiple columns Data

I am using SQL server 2008 and I am trying to unpivot the data. Here is the SQL code that I …

sql sql-server sql-server-2008 unpivot
SQL Server - Include NULL using UNPIVOT

UNPIVOT will not return NULLs, but I need them in a comparison query. I am trying to avoid using ISNULL …

sql-server tsql null unpivot
unpivot and PostgreSQL

Is there a unpivot equivalent function in PostgreSQL?

postgresql unpivot
SQL Server Pivot Table with Counts and Sums

I am trying to get an SQL Server Pivot table to work that allows me to count and then sum …

sql-server tsql pivot unpivot
How to convert columns to rows in sql server

Please consider this table: ID Page Line C01 C02 C03 --------------------------------------------------------------------- 1 122 11 1 0 1 1 123 11 1 1 1 1 124 12 0 0 0 1 125 16 1 0 1 1 127 11 0 1 0 I want to convert this table to this one: …

sql sql-server sql-server-2008 unpivot
Unpivot in spark-sql/pyspark

I have a problem statement at hand wherein I want to unpivot table in spark-sql/pyspark. I have gone through …

apache-spark pyspark apache-spark-sql unpivot
SQL query ; horizontal to vertical

I'm stuck with a SQL query (SQL Server) that involves converting horizontal rows to vertical rows Below is my data …

sql sql-server sql-server-2008 sql-server-2005 unpivot
Transposing Dynamic Columns to Rows

I'd like to know how to unpivot Table_1 into Expected_Result_Table: Table1 ----------------------------------------- Id abc brt ccc ddq eee …

mysql unpivot
How to join row values to column names in a dynamic query

I am developing an application that allows configurable questions and answers. Currently there can be up to 20 answers, but possibly …

sql sql-server unpivot
SQL Server convert columns to rows

I have a sql table with current value and previous value. Id Value1 PValue1 Value2 PValue2 1 A A V V1 2 …

sql sql-server sql-server-2008 tsql unpivot