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)
 Rows as columns

Author  Topic 

Ex
Posting Yak Master

166 Posts

Posted - 2005-10-20 : 22:00:05

Hello all,

Ok I know this is very bad programming
but it’s the only way I can solve the problem with my application.


I am making a simple query select something from myTable

I get

1
2
1
2
5

something like this

is it possible for me to convert these rows into columns instead?

i.e return

1 2 1 2 5

my goal is to turn x rows with 1 column into
x columns with 1 row


any suggestions?



------------------------------------------------------------------

sp2 for IE is FIREFOX !!

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-10-20 : 22:37:41
Will a crosstab float your boat?

http://weblogs.sqlteam.com/jeffs/archive/2005/05.aspx
Go to Top of Page

Ex
Posting Yak Master

166 Posts

Posted - 2005-10-20 : 23:04:28
oo that would float my boat big time

thanks rob :)

------------------------------------------------------------------

sp2 for IE is FIREFOX !!
Go to Top of Page
   

- Advertisement -