Mark Cowne
One Orange Chip
Points: 26986
More actions
January 17, 2008 at 10:27 am
#769326
Assuming you're using SQL Server 2005
SELECT
a.Acct_ID,
STUFF((SELECT ','+f.FlagTitle AS "text()"
FROM Flags f
WHERE a.Acct_ID = f.Acct_ID
ORDER BY f.FlagTitle
FOR XML PATH('')),1,1,'') AS Flags
FROM Accounts a
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
Viewing post 1 (of 2 total)
You must be logged in to reply to this topic. Login to reply