sql server

Posted by Vinay_moduga under Sql Server on 2/18/2010 | Views : 1345 | Status : [Member] | Replies : 2
i have a single row in my table . And I want to get the each value in the row as a column .

eg : my table has columns name,subject,mark1,mark2,mark3,mark4,total

Now I want to get the values like this

name
subject
mark1
mark2
mark3
mark4
total

in an order and not in a single row




Responses

Posted by: Abhi2434 on: 2/18/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
Use Pivot / Unpivot for this :
http://msdn.microsoft.com/en-us/library/ms177410.aspx

I hope this would help you.

www.abhisheksur.com

Vinay_moduga, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 2/24/2010 [Member] Bronze

Up
0
Down
Check
http://www.mssqltips.com/tip.asp?tip=1019

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Vinay_moduga, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response