select f2,max(f3) from tab group by f2

解决方案 »

  1.   

    select * from table1 x
     where f3 in (select max(f3) from table1 
                   where f2 = x.f2);
      

  2.   

    select max(pk),f2,max(f3) from tt
    group by f2
      

  3.   

    SELECT DISTINCT F2,   
             max(F3)  
        FROM x  
    GROUP BY F2  ;
      

  4.   

    select x.* from test x
    where x.f3 =
    (select max(f3)
    from test y 
    where  x.f2=y.f2)基本同三千兄,只是想对于x.f3 in 改为'='后,如果数据量庞大时速度是否要快些!(以上在本上已经测试通知)