Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Coalesce question? Expand / Collapse
Author
Message
Posted Thursday, March 07, 2013 10:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, February 14, 2014 2:14 PM
Points: 2, Visits: 14
I am trying to concatenate the URL column into one csv value for each ApplicantID. I am not having luck achieving the results I am looking for. Any help most appreciated...

SELECT
FASTFacultyApps.LastName,
COALESCE([FacultyApps_TEST].[dbo].[VideoLinks].URL + ',', '') + [FacultyApps_TEST].[dbo].[VideoLinks].URL AS VidList
FROM
[FacultyApps_TEST].[dbo].FASTFacultyApps
JOIN
[FacultyApps_TEST].[dbo].[VideoLinks]
ON
[FacultyApps_TEST].[dbo].[VideoLinks].ApplicantID = [FacultyApps_TEST].[dbo].FASTFacultyApps.ID
WHERE
[FacultyApps_TEST].[dbo].FASTFacultyApps.isArchived = 0

RESULT:


TABLES:



TIA,
Andrew
Post #1428143
Posted Thursday, March 07, 2013 3:37 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, April 14, 2014 10:55 AM
Points: 532, Visits: 984
I applied some quick GoogleFu to find this for you.. there are many examples of what you want out there.

http://www.kodyaz.com/articles/concatenate-using-xml-path.aspx
Post #1428304
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse