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 ««12

UPDATE SQL Query Help ! Expand / Collapse
Author
Message
Posted Thursday, February 20, 2014 10:58 AM This worked for the OP Answer marked as solution


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 8:39 AM
Points: 3,313, Visits: 7,155
It would be as simple as this, as explained in the article:
SELECT t.AID,
Emails = STUFF((SELECT '; ' + t1.EmailID
FROM #TEST1 t1
WHERE t1.AID = t.AID
FOR XML PATH('')), 1, 2, '')
FROM #TEST1 t
GROUP BY t.AID
ORDER BY t.AID




Luis C.
I am a great believer in luck, and I find the harder I work the more I have of it. Stephen Leacock

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1543638
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse