ORACLE:查询各组最新的一条记录
有两种写法:
写法一:over partition by 分析函数
SELECT * FROM (select eb_vipcode,eb_time,MAX(eb_time) over(partition by eb_vipcode)
as "atime" from eb_daskexpdateinfo) x where eb_time = "atime";
写法二:group by
SELECT eb_vipcode,MAX(eb_time) AS "atime" FROM eb_daskexpdateinfo group by eb_vipcode