Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

Who can i convert row values into columns in SQL server?

user-image
Question ajoutée par Noor Ali Chagani , Software Development Manager , The Punjab Healthcare Commission (PHC)
Date de publication: 2014/05/26
Adeel Nayyer Sheikh
par Adeel Nayyer Sheikh , Application Developer (SharePoint Development) , NewBoy FZCO

There are multiple ways to transform rows into columns in SQL. One of those ways is to use PIVOT in SQL like the example below.

 

select col1, col2, col3

from

(

  select value, columnname

  from yourtable

) d

pivot

(

  max(value)

  for columnname in (col1, col2, col3)

) piv;

Ganesh Sampat Abdagire
par Ganesh Sampat Abdagire , Senior .NET Developer , Qatar Islamic Bank

Yes it is possible by using PIVOT keyword in sql

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?