请问下面的功能怎么用一个SQL语句来实现?
假如表T有两列: 
 col1   col2 
 1            A 
 2            D 
 1            B 
 1            C 
 2            E     
 要得到如下结果: 
 col1   col2 
 1            ,A,B,C, 
 2            ,D,E,   
 请问该SQL语句该怎么写?      谢谢.
------解决方案--------------------create table 表(部门 int,人员 varchar(20)) 
 insert into 表 select 1, '张三 ' 
 insert into 表 select 1, '李四 ' 
 insert into 表 select 1, '王五 ' 
 insert into 表 select 2, '赵六 ' 
 insert into 表 select 2, '邓七 ' 
 insert into 表 select 2, '刘八 ' 
 go   
 --创建用户定义函数 
 create function f_str(@department int) 
 returns varchar(8000) 
 as 
 begin 
     declare @ret varchar(8000) 
     set @ret =  ' ' 
     select @ret = @ret+ ', '+人员 from 表 where 部门 = @department 
     set @ret = stuff(@ret,1,1, ' ') 
     return @ret  
 end 
 go     
 --执行 
 select 部门,人员=dbo.f_str(部门) from 表 group by 部门 order by 部门 
 go
------解决方案--------------------SQL2000的話建議寫function   
 create function fn_test(@col1 int) 
 returns varchar(50) 
 AS 
 begin 
 declare @str varchar(50) 
 set @str= ' ' 
 select @str=@str+ ', '+col2  from T where col1=@col1 
 set @str= @str+ ', ' 
 return @str 
 end   
 GO   
 select col1,dbo.fn_test(col1) as col2 
 from T 
 group by col1