ate function fmerg(@company varchar(200))
returns varchar(8000)
as
begin
declare @str varchar(8000)
set @str=''
select @str=@str+','+jobname from zhaopin where company=@company set @str=right(@str,len(@str)-1)
return(@str)
End
go
--调用自定义函数得到结果
select distinct company,dbo.fmerg(company) from zhaopin
追问我知道了,只有俩条命令,没有你这么多的