SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Vertical to Horizontal
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gpc44
Starting Member

20 Posts

Posted - 03/29/2012 :  03:35:56  Show Profile  Reply with Quote
Hi,
i want to bring rows in a Detail-Table (vertical) into horizontal Form with a T-SQL Query (max. 3 Columns). Is there a fast Way without a Cursor ?


OLD
--------------------------
Store PhoneNr
4711 49911-1111111
4711 49911-1111112
4711 49911-1111113


NEW
--------------------------
Store Phone1....... Phone2......... Phone3
4711 49911-11111 49911-11112 49911-11113

many thanks
Nicole

khtan
In (Som, Ni, Yak)

Singapore
16746 Posts

Posted - 03/29/2012 :  03:41:23  Show Profile  Reply with Quote
check out PIVOT operator


KH
Time is always against us

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000