日期:2014-05-17 浏览次数:20539 次
create table Fruit ( FruitName varchar(20) ) insert into Fruit(FruitName ) values('苹果') insert into Fruit(FruitName ) values('香蕉') insert into Fruit(FruitName ) values('葡萄') declare @sql varchar(50) set @sql='' select @sql=@sql+FruitName+',' from Fruit select SUBSTRING(@sql,1,LEN(@sql)-1) AS FruitName /* FruitName -------------------------------------------------- 苹果,香蕉,葡萄 (1 行受影响) */