Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to make a Row value as a column..

Author  Topic 

chandrashekar
Starting Member

3 Posts

Posted - 2004-07-05 : 09:12:13
Hi guys,

Some body asked me the question how would you make the Row values displayed as columns and i made myself invisible before them....i couldn't answer the question.

lets say we run a query

select top 3 column_name from table1

------------
row1
row2
row3
----------
are displayed now i want to make these values as columns....

like i want the table with these row values as cloumns....please suggest how to go about this

thanks in Advance

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-07-05 : 09:15:19
Hi,
There are lots of posts on this topic here.

Search this site for "Crosstab" - Hope that helps.


Duane.
Go to Top of Page

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-07-05 : 13:52:27
also remember if this is for use in another program (usually) there are better solutions to crosstab


for example, in ASP, you can dump the recordset to an array with getRows. The instead of using myArray(col,row), swap the variables to (row,col).

Corey
Go to Top of Page
   

- Advertisement -