根据用户编码分组。根据日期倒序排序只取其中一条

 select * from ( select *  from (SELECT c.*,row_number() over(PARTITION BY c.reg_channels ORDER BY c.CREATE_TIME DESC) rn  FROM app_user c ) where rn=1  )jj  where jj.reg_channels='SAPP002'

 

posted @ 2016-07-06 10:11  也许还年轻  阅读(385)  评论(0编辑  收藏  举报