function test(@cardid,@name,@date)
as
begin
declare @result varchar(100)
select @result=@result+'時間'+','
from sgqd where cardid=@cardid and name=@name and date=@date
group by cardid,name,date
return @result
end
select cardid,name,date,test(cardid,name,date) as datetime from sgqd group by carid,name,date
我这样写的,能再帮我看看吗斑竹 谢谢,似乎有很大的错误!