May 6, 2007 at 10:33 pm
Hi all
I have a table with data like...
________________________
FieldName | Field Value|
--------------------------------
StudentName | srikanth
StudentName | kanth
Qualification | MCA
Qualification | B.SC
Gender | Male
Gender | Male
Religion | Hindu
Religion | Hindu
--------------------------------
i want to show this data like...
______________________________________________________________
Student Name | Qualification | Gender | Religion |
--------------------------------------------------------------
Srikanth | MCA | Male | Hindu |
kanth | B.sc | Male | Hindu |
---------------------------------------------------------------
I have no idea to write the query, can any one help me. if u need more information feel free to ask.
May 6, 2007 at 10:38 pm
I believe you are using 2005 because you posted in 2005 forum so check the Pivot and unpivot ...
http://msdn2.microsoft.com/en-us/library/ms177410.aspx
http://www.devx.com/dbzone/Article/28165
MohammedU
Microsoft SQL Server MVP
May 7, 2007 at 7:43 am
Unless I've missed something in your question the query is straight forward:
Select * from [tablename]
That will return the data from the table, listed row after row with the column names horizontal across the screen and the column values running vertically down the screen.
HTH,
James.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply