select 类别,日期,数量
from table a
where 日期 = (select max(日期) from table where 类别=a.类别)

解决方案 »

  1.   

    联接:
    SELECT L.类别 , L.日期, L.数量
    FROM table L
    JOIN table R
    ON L.类别 = R.类别 
    GROUP BY L.类别 , L.日期, L.数量
    HAVING L.日期= Max(R.日期)子查询:
    select * from table
    where 日期 in (select max(日期) from table group by 类别)
      

  2.   

    select distinct a.类别,b.日期,b.数量
    from table a
    inner join table b
    on a.类别 = b.类别
    where b.日期 = (select max(c.日期) 
    from table c where c.类别 = a.类别)
    order by a.类别
      

  3.   

    知道我的问题出在group by了 
    happydreamer 的联接方法有些看不懂 呵呵 
    各位的试过了 都行