日期:2014-05-18 浏览次数:20408 次
select * from tbname a where not exists ( select 1 from tbname where F1=a.F1 and F2=a.F2 and F3<a.F3 )
------解决方案--------------------
SELECT F1,F2,MIN(F3) F3 FROM kdp_12345 GROUP BY F1,F2
------解决方案--------------------
直接分组,用max(),min()即可.
select f1,f2,max(f3) f3 from tb group by f1,f2
select f1,f2,min(f3) f3 from tb group by f1,f2