
Answer-first summary for fast verification
Answer: PIVOT
The SQL keyword 'PIVOT' is used to rotate a table, converting it from a long format to a wide format by aggregating and spreading data across columns based on a specified attribute.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
In the context of transforming data in SQL, especially when dealing with data analysis tasks, one often needs to reshape data from a long format (where each row represents an observation) to a wide format (where each row represents an entity and columns represent different attributes of that entity). Which SQL keyword can be used to achieve this transformation?
A
TRANSFORM
B
PIVOT
C
SUM
D
CONVERT
No comments yet.