Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Column to Row

Status
Not open for further replies.

bangalibhai

Programmer
Oct 22, 2002
26
US
Is it Possible to do this. I have the below displayed column wise.

1 2 3 4 5 6 7 8

I want it displayed row wise

1
2
3
4
5
6
7
8

Thanks in advance.
 
S[!]o[/!]meo[!]n[/!]e told me it's [!]p[/!]ossible to do this i[!]n[/!] Excel. Have you considered [!]t[/!]his as an option?

-George

"the screen with the little boxes in the window." - Moron
 
If you must do this in SQL please provide version info. There are loads of posts on here that will help you do this, but some method are version specific.

Hope tis helps,

Alex

[small]----signature below----[/small]
I don't do any programming whatsoever

Ignorance of certain subjects is a great part of wisdom
 
Alex, can you please point me to the right direction. I did a search but it did not return anything in 2000 version.
 
cross join with a derived table (select col=1 union all select 2 union all select 3... select 8)
and do

select
case col when 1 then [col1]
when 2 then [col2]
when 3 then [col3]
... [col8]
end

[COLOR=black #e0e0e0]For SQL and technical ideas, visit my blog, Squared Thoughts.[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top