Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

concatenate strings from different records

Status
Not open for further replies.

dave796

Technical User
Aug 21, 2005
11
0
0
Hi im wondering if there is a way to concatenate a set of strings when field1 is the same hopefully with a comma seperating each part. E.G

Field1 Field2
abc 122qq
def 456ww
abc 789rt
ghi 999zt
def 873gh

EQUALS
Field1 Field2
abc 122qq, 789rt
def 456ww, 873gh
ghi 999zt
 
what database are you using...in SQL Server we can use COALESCE function to do this...

-DNG
 
DNG, surely there's more to it than just a COALESCE

in MySQL, you can use the GROUP_CONCAT function

r937.com | rudy.ca
 
ok thanks I didn't find out about the COALESCE function managed to use the GROUP_CONCAT function. Thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top