select distinct 字段1 from 表orselect 字段1 from 表 group by 字段1

解决方案 »

  1.   

    如果显示所有字段:
    --显示后半部分最大的select 字段1
           ,max(字段2)
    from 表
    group by 字段1
    orselect * from 表 t
    where 字段2=(select max(字段2) from 表 where 字段1=t.字段1)select * from 表 t
    where not exists(select 1 from 表 where 字段1=t.字段1 and 字段2>t.字段2)
    --显示后半部分最小的select 字段1
           ,min(字段2)
    from 表
    group by 字段1
    orselect * from 表 t
    where 字段2=(select min(字段2) from 表 where 字段1=t.字段1)select * from 表 t
    where not exists(select 1 from 表 where 字段1=t.字段1 and 字段2<t.字段2)