About 75,400 results
Open links in new tab
  1. Convert Rows to columns using 'Pivot' in SQL Server

    Apr 10, 2013 · 412 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 …

  2. SQL Server dynamic PIVOT query? - Stack Overflow

    SQL Server dynamic PIVOT query? Asked 13 years, 7 months ago Modified 2 years, 2 months ago Viewed 371k times

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

    Mar 4, 2022 · This is my sample table, I want to pivot the category column and get the sales, stock and target as rows I want the sample output in this form as shown in the below wherein …

  4. Simple way to transpose columns and rows in SQL?

    The dynamic version queries both yourtable and then the sys.columns table to generate the list of items to UNPIVOT and PIVOT. This is then added to a query string to be executed. The plus …

  5. 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 …

  6. SQL Server Pivot Table with multiple column aggregates

    The least complicated, most straight-forward way of doing this is by simply wrapping your main query with the pivot in a common table expression, then grouping/aggregating.

  7. How to Pivot table in BigQuery - Stack Overflow

    So in your standard sql example, it assumes the values to be transposed to columns are known and unchanging. Is there a way to dynamically pivot columns?

  8. Understanding PIVOT function in T-SQL - Stack Overflow

    However, if you have more columns in the source it will break the results into multiple rows instead of one row per pivot based on unique values per additional column (as Group By …

  9. SQL Pivot on dates column? - Stack Overflow

    23 If you are going to be running this query in SQL Server, then you can use the PIVOT function:

  10. sql - Pivoting rows into columns dynamically in Oracle - Stack …

    Apr 22, 2017 · First of all, dynamically pivot using pivot xml again needs to be parsed. We have another way of doing this by storing the column names in a variable and passing them in the …