表:tableA
字段: 
t1  == varchar(10)
t2  == double(13,2)
t3  == date内容:t1    t2   t3
a     11   2008-9-1
a     12   2008-9-4
a     13   2008-9-9
b     11   2008-9-3
b     11   2008-9-10查询结果:
t1    t2   t3
a     13   2008-9-9
b     11   2008-9-10

解决方案 »

  1.   

    select *
    from tablea
    where (t1 || t3) in(
                select t1 || max(t3)
                 from tablea
                group by t1
               )
      

  2.   

    ||
    是oracle中的
    access换成&
      

  3.   

    select a.* from tableA  a Inner join 
    (select t1,Max(t2) as t2 from tableA group by t1) b 
    on a.T1=b.t1 and a.T2=b.T2
      

  4.   


    楼上的有误吧 看样子是按t3排的
    SELECT B.T1,B.T2,B.T3 FROM TABLEA B
    RIGHT JOIN 
    (SELECT MAX(T3) T3 FROM TABLEA
    GROUP BY T1) A
    ON A.T3=B.T3
      

  5.   

    select a.* 
    from tableA a Inner join (select t1,Max(t3) as t3 from tableA group by t1) b 
    on a.t1=b.t1 and a.t3=b.t3