create table #t(字段1 varchar(10),字段2 varchar(10)) insert into #t select 'a','内容1' insert into #t select 'a','内容2' insert into #t select 'b','内容3' insert into #t select 'b','内容4' insert into #t select 'b','内容5'select a.* from #t a where a.字段2 = (select top 1 字段2 from #t where 字段1=a.字段1 order by newid())
insert into #t select 'a','内容1'
insert into #t select 'a','内容2'
insert into #t select 'b','内容3'
insert into #t select 'b','内容4'
insert into #t select 'b','内容5'select
a.*
from
#t a
where
a.字段2 = (select top 1 字段2 from #t where 字段1=a.字段1 order by newid())
的可以随机显示,挺好