Which Transact-SQL operator should you use?

You use Microsoft SQL Server 2012 database to develop a shopping cart application.
You need to rotate the unique values of the ProductName field of a table-valued expression into
multiple columns in the output.
Which Transact-SQL operator should you use?

You use Microsoft SQL Server 2012 database to develop a shopping cart application.
You need to rotate the unique values of the ProductName field of a table-valued expression into
multiple columns in the output.
Which Transact-SQL operator should you use?

A.
CROSS JOIN

B.
CROSS APPLY

C.
PIVOT

D.
UNPIVOT

Explanation:
http://technet.microsoft.com/en-us/library/ms177634.aspx



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Durga Prasad Palepu

Durga Prasad Palepu

C

Novel Purification

Novel Purification

We use pivot queries when we need to transform data from row-level to columnar data. So answer is C