반응형 COUNT(*) OVER1 PARTITION BY PARTITION BY GROUP BY 사용하지 않고, COUNT 조회 하기 SELECT * FROM ( SELECT RANK() OVER (PARTITION BY ORD_YMD, ORD_NUM ORDER BY SEND_DT desc) AS SEND_RANK , ORD_YMD , ORD_NUM , SEND_DT , SEND_YN , COUNT(*) OVER (PARTITION BY ORD_YMD, ORD_NUM) CNT FROM SM_MAIL_SEND WHERE 1=1 AND TMPL = 'AAA' ) A WHERE SEND_RANK = 1 2019. 1. 14. 이전 1 다음 반응형