表A有c,d等字段
想获得c字段指不重复的所有记录应该怎么写

解决方案 »

  1.   

    select c,d from a group by c
      

  2.   

    select   *   from   a   where   not   exists(select   1   from   a   b  where   name=b.c   and   d>b.d)
      

  3.   

    select * from a where c not in (select c from a group by c having count(c)>1)
      

  4.   

    select *
    from a t
    where (select count(1) from tb where c=t.c)=1
      

  5.   

    tb改为a
    select *
    from a t
    where (select count(1) from a where c=t.c)=1
      

  6.   

    select *
    from A
    group by c