Possible Duplicates:
How to return multiple values in one column (T-SQL)?
Simulating group_concat MySQL function in MS SQL Server 2005?
Hi,
Suppose I have 2 tables which i join in which i do a INNER JOIN using a key field.
Schema:
TABLE #a kf int
TABLE #b kf int, data varchar(5)
Now if #a has a single row with value as 1 and #b has multiple rows with the same key 1 as
- 1 DBD
- 1 DBE
- 1 HDG
Now when i do a join instead of getting 3 rows , Is it possible to get one row with the data values in comma separated manner like
1 DBD,DBE,HDG