标签:
select * from
(select t.*, row_number() over(partition by 分组字段 order by 排序字段 desc ) rn
from tablename t )
where rn=1
select *
from (select t.*,
row_number() over(partition by campaignid order by createat desc) rn
from app_campaigntype_summary t
where createat <= to_date(‘2015-01-09‘, ‘yyyy-mm-dd‘))
where rn = 1
标签:
原文地址:http://my.oschina.net/Cheney521/blog/373902