日期:2014-05-18  浏览次数:20412 次

分组求最大日期
按客户编号分组取最大时间

------解决方案--------------------
select *from(select row_number()over(partition by 客户编号 order by 日期) as number,* from table)a where number=1
------解决方案--------------------
select *from table a where 日期=(select max(date) from table b where a.id=b.id)