Skip to content

Commit 11c8979

Browse files
Merge pull request #31965 from mariyaali/patch-13
Update from-using-pivot-and-unpivot.md
2 parents 82b0892 + b758f42 commit 11c8979

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

docs/t-sql/queries/from-using-pivot-and-unpivot.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn about the Transact-SQL PIVOT and UNPIVOT relational operators
44
author: VanMSFT
55
ms.author: vanto
66
ms.reviewer: wiassaf, randolphwest
7-
ms.date: 08/12/2024
7+
ms.date: 10/01/2024
88
ms.service: sql
99
ms.subservice: t-sql
1010
ms.topic: reference
@@ -23,16 +23,19 @@ helpviewer_keywords:
2323
- "rotating columns"
2424
dev_langs:
2525
- "TSQL"
26-
monikerRange: ">=aps-pdw-2016 || =azuresqldb-current || =azure-sqldw-latest || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current"
26+
monikerRange: ">=aps-pdw-2016 || =azuresqldb-current || =azure-sqldw-latest || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =fabric"
2727
---
2828
# FROM - Using PIVOT and UNPIVOT
2929

30-
[!INCLUDE [sql-asdb-asdbmi-asa-pdw](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw.md)]
30+
[!INCLUDE [sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw.md)]
3131

3232
You can use the `PIVOT` and `UNPIVOT` relational operators to change a table-valued expression into another table. `PIVOT` rotates a table-valued expression by turning the unique values from one column in the expression into multiple columns in the output. `PIVOT` also runs aggregations where they're required on any remaining column values that are wanted in the final output. `UNPIVOT` carries out the opposite operation to `PIVOT`, by rotating columns of a table-valued expression into column values.
3333

3434
The syntax for `PIVOT` is easier and more readable than the syntax that might otherwise be specified in a complex series of `SELECT...CASE` statements. For a complete description of the syntax for `PIVOT`, see [FROM clause](from-transact-sql.md).
3535

36+
> [!NOTE]
37+
> Repeated use of `PIVOT`/`UNPIVOT` within a single T-SQL statement can negatively impact query performance.
38+
3639
[!INCLUDE [article-uses-adventureworks](../../includes/article-uses-adventureworks.md)]
3740

3841
## Syntax

0 commit comments

Comments
 (0)