select 字段1  max(字段2)  from tablename group by 字段1 
or:
select 字段1  min(字段2)  from tablename group by 字段1

解决方案 »

  1.   

    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())
      

  2.   

    libin_ftsafe(子陌红尘) 
    的可以随机显示,挺好
      

  3.   

    libin_ftsafe(子陌红尘)是个热心的好同志,我们都应该向你学习!:)