取记录.
记录:
a 2007-1-1
a 2007-1-2
a 2007-1-3
a 2007-1-4
b 2007-1-11
b 2007-1-21
b 2007-1-31
b 2007-1-14
b 2007-1-15
c 2007-1-21
c 2007-1-24
去a b c 3条记录 按日期排序
------解决方案--------------------select
t.*
from
表 t
where
not exists(select 1 from 表 where type=t.type and date> t.date)
order by
t.date desc