declare @T table(学号 int,成绩 int)
insert into @t select 2001,98
union all select 2005,100
union all select 2006,180
union all select 2007,190
union all select 2009,200
declare @sql varchar(1000)
set @sql=''
select @sql=@sql+'|'+cast(学号 as varchar(100)) from @t where 成绩 between 90 and 200
select stuff(@sql,1,1,'')
declare @T table(学号 int,成绩 int)
insert into @t select 2001,98
union all select 2005,100
union all select 2006,180
union all select 2007,190
union all select 2009,200
declare @sql varchar(1000)
set @sql=''
select @sql=@sql+'|'+cast(学号 as varchar(100)) from @t where 成绩 between 90 and 200
select stuff(@sql,1,1,'')