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)
 Row into Column

Author  Topic 

rajukurian
Starting Member

8 Posts

Posted - 2008-09-11 : 11:15:07
Hi,

I am facing problem while shifting one row into column.
My table is like this.

ID COSTSET COST
1 1 1.23
1 2 1.34
2 1 2.87
2 2 2.90

-====

I want the output like

ID COSTSET1 COSTSET2
1 1.23 1.34
2 2.87 2.90


any help will be appriciate.


Thanks
RK

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-11 : 11:37:49
Use the new PIVOT operator in SQL Server 2005.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

rajukurian
Starting Member

8 Posts

Posted - 2008-09-11 : 12:07:33
Thanks Peso.
Go to Top of Page
   

- Advertisement -