My SQL Server view
SELECT
geo.HyperLinks.CatID, geo.Tags.Tag, geo.HyperLinks.HyperLinksID
FROM
geo.HyperLinks LEFT OUTER JOIN
geo.Tags INNER JOIN
geo.TagsList ON geo.Tags.TagID = geo.TagsList.TagID ON geo.HyperLinks.HyperLinksID = geo.TagsList.HyperLinksID WHERE HyperLinksID = 1
returns these...
HyperLinksID CatID Tags
1 2 Sport
1 2 Tennis
1 2 Golf
How should I modify above to have result like
HyperLinksID CatID TagsInOneRowSeperatedWithSpaceCharacter
1 2 Sport Tennis Golf
UPDATE: As Brad suggested i came up here...
DECLARE @TagList varchar(100)
SELECT @TagList = COALESCE(@TagList + ', ', '') + CAST(TagID AS nvarchar(100))
FROM TagsList
WHERE HyperLinksID = 1
SELECT @TagList
Now the result looks like
HyperLinksID CatID TagsInOneRowSeperatedWithSpaceCharacter
1 2 ID_OF_Sport ID_OF_Tennis ID_OF_Golf
And of course i have to combine the contents FROM the @TagList variable and the ORIGINAL SELECT statement...
Which means that i ll have to wait for the holly SO boundy :(