How to convert row into colun in sql server ?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Javeed M ShaikhRank #839 · 2.7K reputationPosted Apr 11, 2013, 11:15 AM EDT
Please refer to this article:
http://www.c-sharpcorner.com/UploadFile/suthish_nair/convert-rows-to-columns-in-sql-server-20082005/
Jignesh TrivediRank #16 · 50.3K reputationPosted Apr 11, 2013, 7:45 PM EDT
hi,
it depend upon your requirement.
you just want to convert whatever row you have in to column or you want to perform some aggregate option on row while converting to column.
you can use pivot query in the second case.
http://msdn.microsoft.com/en-in/library/ms177410%28v=sql.105%29.aspx
http://blogs.msdn.com/b/spike/archive/2009/03/03/pivot-tables-in-sql-server-a-simple-sample.aspx
hope this will help you.