日期:2014-05-17 浏览次数:20622 次
select * from
(select *,row_number() over(partition by LOTID order by CleanTime) 'rn'
from [表名]
) t where rn=1
select *
from
(
select *,
row_number() over(partition by LOTID order by CleanTime desc) as rownum
from tb
) t
where rownum=1