Answer Posted / Chandrakant Bharti
UNPIVOT is a SQL operator used to transpose rows into columns. It allows you to convert rows with multiple columns into a single row with multiple identical column names, which can be useful for analyzing data from various dimensions. For example, the following query uses UNPIVOT to transform a table with two columns (Product and Q1-2020, Q2-2020) containing sales data for each quarter:nn SELECT * FROM SalesDatan UNPIVOT(n SalesAmount FOR Quarter IN (Q1-2020 AS Q1,n Q2-2020 AS Q2)n )
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a scheduled job or what is a scheduled task?
You have a stored procedure, which execute a lengthy batch job. This stored procedure is called from a trigger you do not want to slow the data entry process you do not want trigger to wait for this batch job to finish before it completes itself what you can do to speed up the process?
What are different types of constraints?
When should you use an instead of trigger?
How can I check that whether automatic statistic update is enabled or not?
How to enter binary string literals in ms sql server?
Why we use the openxml clause?
How do I start sql server 2017?
Can one drop a column from a table?
What are wait types?
Can sql servers link to other servers like oracle?
What is the primary use of the model database?
How can we solve concurrency problems?
what is spatial nonclustered index
Why and when do stored procedure recompile?