Advertisement

11.22.2007 at 07:49AM PST, ID: 22977707
[x]
Attachment Details

Concatenate string using Group By

Asked by therealdreamer81 in SQL Query Syntax, MS SQL Server, SQL Server 2005

Tags: group, concat, string, concatenate

How do I concatanate strings with MSSQL?

e.g. table values:
cGroup  cText
A           L
A           M
B           V

query:
select cGroup, concat(cText) as cTextConcat
from myTable
group by cGroup

Result set:
cGroup cTextConcat
A         LM
B         VStart Free Trial
[+][-]11.22.2007 at 07:55AM PST, ID: 20334964

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, MS SQL Server, SQL Server 2005
Tags: group, concat, string, concatenate
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 3
Solution Grade: A
 
 
[+][-]11.22.2007 at 08:25AM PST, ID: 20335201

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.17.2008 at 06:38AM PST, ID: 20914120

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628