I was wondering if it was possible to concatenate a subquery so that it returns a comma-delimited value, inside a select statement.For instance, I have table #1:UsersUserID UserName1 Joe2 BobRightsUserID RightID1 11 21 3The result set I want is:UserID UserName Rights1 Joe 1,2,32 Bob NULL
I tried making a user defined function that would grab the subquery then concatenate it, but since i can't use the exec statement, the select statement would have to be static ... i'd like to be able to change the criteria on the rights table.thanks for the help in advance.