declare @Result varchar(200)
set @Result=''
select
case
when route_spot is not null then @Result=@Result+route_spot+',' end
end
from
tlinerouteinfo
where
route_lineid=10select @Result————————————————————
消息 102,级别 15,状态 1,第 17 行
'=' 附近有语法错误。
set @Result=''
select
case
when route_spot is not null then @Result=@Result+route_spot+',' end
end
from
tlinerouteinfo
where
route_lineid=10select @Result————————————————————
消息 102,级别 15,状态 1,第 17 行
'=' 附近有语法错误。
set @Result=''
select
@Result=@Result+route_spot+',' from tlinerouteinfo
where
route_lineid=10 and route_spot is not null select @Result
少 ELSE
select case when then else end --语法格式
select @Result= @Result+
case
when route_spot is not null then route_spot+','
else ''
end
from 或者用一楼的