select * from 表 t
where (select count(1) from 表 where name=t.name)=1

解决方案 »

  1.   

    同上
    如果有分组字段也可一这样:
    select * from 表 group by 分组字段 having count(分组字段)=1
      

  2.   

    select name from table1 group by name having count(name) = 1 ;
    应该差不多!!!
      

  3.   

    vivianfdlpw() :
    select * from 表 t
    where (select count(1) from 表 where name=t.name)=1
      

  4.   

    若要显示表全部字段用distinct方便些。
    否则用group by 更好,当然性能会受影响。
    例如:
       F1 F2 F3
    #1 1  2  3
    #2 2  3  4
    #3 3  3  4
    #4 2  3  4
    写select distinct F1,F2,F3 from T
    和select min(F1),min(F2),min(F3) from T group by F1,F2,F3都可以只显示1、2、3条记录