select t1.* 
from tbl t1,(select col1 from tbl t2 group by col1)t2 
where t1.col1=t2.col1

解决方案 »

  1.   

    select col_1,min(col_2) as col_2 from tbl
    group by col_1
      

  2.   

    select col1,max(col2) as col2 from tbl group by col1 having count(*)=1
      

  3.   

    select * from table1 where coll in (select coll from table1 group by coll having count(*) =1 )
      

  4.   

    select col_1,min(col_2) from tbl group by col_1 having sum(1) = 1
      

  5.   

    看错了:select col_1,min(col_2) as col_2 from tbl
    group by col_1
    having count(*)=1
      

  6.   

    从速度考虑:
    select * from tbl a
    where not exists (
    select 1 from tbl
    where col_1=a.col_1
    and col_2<>a.col_2
    )
      

  7.   

    第一个错了:select t1.* 
    from tbl t1,(select col1 from tbl t2 group by col1 having count(*)=1)t2 
    where t1.col1=t2.col1