About 410,000 results
Open links in new tab
  1. Understanding PIVOT function in T-SQL - Stack Overflow

    A pivot is used to convert one of the columns in your data set from rows into columns (this is typically referred to as the spreading column). In the example you have given, this means …

  2. Convert Rows to columns using 'Pivot' in SQL Server

    Apr 10, 2013 · If you are using SQL Server 2005+, then you can use the PIVOT function to transform the data from rows into columns. It sounds like you will need to use dynamic sql if …

  3. SQL Server dynamic PIVOT query? - Stack Overflow

    This solution requires the creation of a stored procedure so if that is out of the question for your needs please stop reading now. This procedure is going to take in the key variables of a pivot …

  4. t sql - How to pivot on multiple columns in SQL Server? - Database ...

    Dec 6, 2017 · Well, for performance, the two PIVOT's require only a single scan over the table, where as the multiple joins require at minimum multiple seeks. Absolute performance …

  5. t sql - SQL Server: Examples of PIVOTing String data - Stack …

    Trying to find some simple SQL Server PIVOT examples. Most of the examples that I have found involve counting or summing up numbers. I just want to pivot some string data. For example, I …

  6. Pivots with dynamic columns in SQL Server - Stack Overflow

    Oct 20, 2011 · I am working on an SQL Query using pvots with dynamic columns in SQL Server (T-sql). Rather than submitting my lengthy query, I’m illustrating my problem with a simplified …

  7. In SQL Server how to Pivot for multiple columns - Stack Overflow

    Mar 4, 2022 · The key point here is that you create new category values by appending 1 or 2 to the end. Without doing this, the pivot query won't work properly.

  8. sql - TSQL PIVOT MULTIPLE COLUMNS - Stack Overflow

    Since you want to pivot multiple columns of data, I would first suggest unpivoting the result, score and grade columns so you don't have multiple columns but you will have multiple rows. …

  9. sql server - T-SQL pivot where clause - Stack Overflow

    in SQL Server i want PIVOT a table and add a WHERE clause but i cant figure out the syntax. The data

  10. t sql - Pivoting with Sum function in tsql - Stack Overflow

    Jul 6, 2012 · 6 You can easily use a PIVOT for this. As the other have said you can use a Static Pivot that you code the columns that you want or you can use a Dynamic Pivot, which get the …