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
 General SQL Server Forums
 New to SQL Server Programming
 Result display

Author  Topic 

abc123
Starting Member

47 Posts

Posted - 2009-03-04 : 06:26:49
i have one table

with following data

col1 col2
4 0.0
4 1.1
4 0.5
5 1.0
5 6.1
5 9.0
6 8.0
6 5.0
6 1.1

i want the result in following format


col1 col2 col3 col4
4 0.0 1.1 0.5
5 1.0 6.1 9.0
6 8.0 5.0 1.1

how i can get this?

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-03-04 : 06:30:36
sql 2005, http://technet.microsoft.com/en-us/library/ms177410.aspx
sql 2k, http://www.sqlteam.com/article/dynamic-cross-tabs-pivot-tables
Go to Top of Page

abc123
Starting Member

47 Posts

Posted - 2009-03-04 : 06:37:09
is there any ohter way rather than PIVOT?
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-03-04 : 06:45:01
yes, Look at the second link I posted.
Go to Top of Page
   

- Advertisement -