I'm using MSSQL 2005 and am trying to create a view that does the following.
If the dataset looks like this:
Column A Column B
---------------------
host1 ABC
host2 AAA
host1 CDE
host3 FFF
host2 BDE
host1 ZZZ
The output of the view would be something like this:
Column A Column B
---------------------
host1 ABC,CDE,ZZZ
host2 AAA,BDE
host3 FFF
So basically column A will be distinct records and column B will be a string that contains all of the column A records separated by a comma. Does anyone know of a simple way to accomplish this in a view?
Thanks!
If the dataset looks like this:
Column A Column B
---------------------
host1 ABC
host2 AAA
host1 CDE
host3 FFF
host2 BDE
host1 ZZZ
The output of the view would be something like this:
Column A Column B
---------------------
host1 ABC,CDE,ZZZ
host2 AAA,BDE
host3 FFF
So basically column A will be distinct records and column B will be a string that contains all of the column A records separated by a comma. Does anyone know of a simple way to accomplish this in a view?
Thanks!