LearnItFirst User Forum

New SQL Server 2008 DBA Course
Welcome Guest Search | New Posts | Members | Log In | Register

Display the record in column wise Options
rameshduraikannu
Posted: Friday, December 25, 2009 4:56:51 AM
Rank: Newbie

Joined: 12/25/2009
Posts: 1
Points: 3
Where do you live?: chennai
Hai friends

I want to display the data in column wise

the actual is look like this
Quote:

location

loc1
loc2
loc3
loc4
loc5
loc6



want to display the like this way
Quote:

location location location
------- ------- --------
loc1 loc2 loc3
loc4 loc5 loc6




i want to display 3 column and 3 row.

it is possible to display the data like this way

Scott Whigham
Posted: Friday, February 26, 2010 8:53:45 AM


Rank: Super Mod

Joined: 3/20/2006
Posts: 460
Points: 1,002
Where do you live?: Dallas, TX
You have two choices - a self join or a correlated subquery in the SELECT clause. Check out Course 160 - it has lots of videos that do this sort of thing.

http://www.learnitfirst.com/Course/160/Video/2332/When-to-Use-a-Self-JOIN.aspx

http://www.learnitfirst.com/Course/160/Video/2394/Correlated-Subqueries-in-the-SELECT-Column-List.aspx
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.