Advertisement

04.30.2008 at 04:40PM PDT, ID: 23367290
[x]
Attachment Details

How can I use GROUP_CONCAT in ms sql

Asked by Luke101 in MS SQL Server, SQL Server 2005, SQL Server 2008

Tags: ,

How can I use a GROUP_CONCAT function in ms sql. is there any alternative to this? I have a table likethis


Name---------------------------Favorite Color ID
Jim------------------------------3
Bob-----------------------------3
Bob-----------------------------12
Norman-------------------------2
Norman-------------------------1

i need to do an inner join on the tables to get each favorite color name for each Person

I need the result to print like this

Name---------------------------Favorite(s)
Jim------------------------------Red
Bob-----------------------------Red,Yellow
Norman------------------------Black, White

Is it possible to do this without stored Procedures
Start Free Trial
 
Loading Advertisement...
 
[+][-]04.30.2008 at 04:45PM PDT, ID: 21475486

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: MS SQL Server, SQL Server 2005, SQL Server 2008
Tags: ms sql, sql
Sign Up Now!
Solution Provided By: paulop1975
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.30.2008 at 06:01PM PDT, ID: 21475786

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

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

 
[+][-]04.30.2008 at 06:10PM PDT, ID: 21475818

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.

 
[+][-]04.30.2008 at 06:27PM PDT, ID: 21475893

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.

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