|
Posted by Bart op de grote markt on 11/23/07 13:52
I have also tried out the solution below (with the same test-table),
with a function. But again the response time is very slow...
create function dbo.fn_groupIt(@test1 varchar(5),@test3 varchar(5))
returns varchar(5000)
as
begin
declare @out varchar(5000)
select @out = coalesce(@out + ',' + convert(varchar,test2),
convert(varchar,test2))
from test
where test1 = @test1 and
test3 = @test3
return @out
end
select test1, dbo.fn_groupIt(test1,test3) test2,test3
from (
select test1,test3
from test
group by test1,test3
) a
[Back to original message]
|