ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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

user-image
تم إضافة السؤال من قبل Noor Ali Chagani , Software Development Manager , The Punjab Healthcare Commission (PHC)
تاريخ النشر: 2014/05/26
Adeel Nayyer Sheikh
من قبل 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
من قبل Ganesh Sampat Abdagire , Senior .NET Developer , Qatar Islamic Bank

Yes it is possible by using PIVOT keyword in sql

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟