select count(*)
from emp
group by name
having name='你要查找的名字'
declare @tt Table (name varchar(100))
insert into @tt values ('张三')
insert into @tt values ('李四,张三')
insert into @tt values ('王五 赵六')
insert into @tt values ('赵六')
insert into @tt values ('李四')
insert into @tt values ('王五,赵六 李四')
insert into @tt values ('赵六,王五')
declare @line varchar(max)
select @line = STUFF(( SELECT ',' + name FROM @tt FOR XML PATH('')) , 1, 1, '')
select @line = REPLACE(@line,' ',',')
print(@line)