dbTalk Databases Forums  

Combine record

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Combine record in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dede
 
Posts: n/a

Default Combine record - 08-17-2007 , 07:05 PM






Hi guys..
is there any query to do this action:
i want to combine view record into a single record.
exm.

table 1
Name A B
Jack 10 22
jack 12 21
jack ... ....
jack 1 11
ben 12 2
ben 3 2
ben ... ...


into:
View 1
Name combine
jack 10,22 and 12,21and1,11 and .....
ben 12,2 and 3,2 and......


thx before..


Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Combine record - 08-18-2007 , 04:17 PM






dede (neolempires2 (AT) gmail (DOT) com) writes:
Quote:
is there any query to do this action:
i want to combine view record into a single record.
exm.

table 1
Name A B
Jack 10 22
jack 12 21
jack ... ....
jack 1 11
ben 12 2
ben 3 2
ben ... ...


into:
View 1
Name combine
jack 10,22 and 12,21and1,11 and .....
ben 12,2 and 3,2 and......
Check out http://www.projectdmx.com/tsql/rowconcatenate.aspx for
suggestions.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.