Is there a way to get SQL Server to return a comma seperated list of ID's in a subquery?SELECT CompanyName, (SELECT CompanyType FROM CompaniesToTypes WHERE CompanyID = 21426) AS TypesFROM ....[blah]
But it fails if the subquery returns more than one row.I'm looking for an output like:ID Name Type 1 "Nick's Company" "A,B,C"2 "Fred PLC" "A,C,T,Y"3 "Mark Ltd" "B"
But I can't seem to find a way of doing it...Has anyone got any ideas?This is mainly important because of the way the rest of the query works - otherwise I'd just get the list at the application level.Thanks!Nick...Edited by - nmg196 on 08/01/2001 13:34:24