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 2005 Forums
 Transact-SQL (2005)
 how to display records horizontally in sqlserver?

Author  Topic 

senthil.dhaktchana
Starting Member

3 Posts

Posted - 2008-07-25 : 08:13:31
hi experts,
i have only one coloumn in a table i want to dispaly all the datas in a row.Name of the table is student which contains only one coloumns slno
Student
Slno
1
2
3
4
5
I want to display them as
slno 1 2 3 4 5

pls help me...
thanks in advance..
senthil.d

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-25 : 08:16:35
use PIVOT operator


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

senthil.dhaktchana
Starting Member

3 Posts

Posted - 2008-07-25 : 08:22:06
hi khtan,
can u pls send the query for me?
thanks in advance
senthil.d
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-25 : 08:25:39
check out PIVOT in the Books OnLine. There are example in there


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -