About 196,000 results
Open links in new tab
  1. How to pivot on multiple columns in SQL Server?

    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 difference will depend …

  2. pivot - MS SQL Server pivoting without aggregation - Database ...

    Dec 16, 2022 · For pivot you do need an aggregate function. But even with that, you can get the requested results. SELECT pivot_table.column3, pivot_table.column2, pivot_table.column1 FROM …

  3. sql server - QUERY - pivot multiple columns, variable number of rows ...

    sql-server sql-server-2008-r2 pivot Share Improve this question edited May 26, 2014 at 17:17

  4. sql server - How to do a SELECT inside of a PIVOT - Database ...

    Jul 7, 2015 · I am trying to SELECT values from a column in my database in order to perform a PIVOT on those values without hard-coding them. SELECT * FROM (SELECT ItemType, [Status] FROM …

  5. sql server - PIVOT, Row_Number () returning multiple rows - Database ...

    Apr 20, 2018 · I'm trying to pivot a list of emails onto a single row, but for some reason my primary email address is getting a row of its own, so Im ending up with two rows per contact. CREATE TABLE …

  6. SQL Server PIVOT returns only one row [duplicate]

    Jun 9, 2021 · 4 When you are using a PIVOT you are aggregating the data and since you are using MAX() you're only going to be able to return one value for each of your new columns. In order to …

  7. sql server - How to pivot without fixed columns in TSQL? - Database ...

    Nov 2, 2015 · The PIVOT function will work but first you'll need to concatenate a SQL string with all the Compartment values for each TruckId. First, you'll define all your parameters:

  8. sql server - Sum of two columns from pivot - Database Administrators ...

    Sep 18, 2014 · Sum of two columns from pivot Ask Question Asked 11 years, 1 month ago Modified 10 years, 10 months ago

  9. How to pivot data in SQLite - Database Administrators Stack Exchange

    May 6, 2020 · │ 2 │ how are you │ │ come es stas │ └───────────┴─────────────┴─────────┴──────────────┘ The second (and …

  10. sql server - SQL Pivot with multiple columns - Database Administrators ...

    Sep 15, 2021 · SQL Pivot with multiple columns [duplicate] Ask Question Asked 4 years, 1 month ago Modified 4 years, 1 month ago