select F1,max(F2) as F2,max(F3) as F3 from tb group by F1

解决方案 »

  1.   

    但是你Group by F1之后,显示的表就只是F1
    1
    2
    3后面的就没有了呀。
      

  2.   

    select F1,max(F2),max(F3) from 表名 group by F1
      

  3.   

    select tb.* from tb,(select F1,max(F3) F3 from tb group by F1) t
    where tb.F1=t.F1 and tb.F3=t.F3
      

  4.   

    或者
    select * from tb t
     where not exists(select * from tb where F1=t.F1 and F3>t.F3)
      

  5.   

    我也来一个select L.* from
     tb L JOIN (select F1,max(F3) F3 from tb group by F1) R
          ON L.F1=R.F1 AND L.F3=R.F3