分组中获取时间最新得一条数据
解析:根据APP_LID分组,按照FINISH_TIME不为空倒叙排序,mtime取分组中排序在第一位的数据
SELECT * FROM ( SELECT ROW_NUMBER () OVER ( PARTITION BY APP_LID ORDER BY FINISH_TIME DESC NULLS LAST ) mtime, FINISH_TIME, APP_LID FROM tabName WHERE STATUS = 'STA008' ) WHERE mtime = 1