SELECT PRD_NO
,MAX(PUB_TIME) AS LAST_PUB_TIME
,MAX(PUB_USR_ID) KEEP(DENSE_RANK LAST ORDER BY PUB_TIME) AS LAST_PUB_USR_ID
,MIN(PUB_TIME) AS FIRST_PUB_TIME
,MIN(PUB_USR_ID) KEEP(DENSE_RANK FIRST ORDER BY PUB_TIME) AS FIRST_PUB_USR_ID
FROM TB_M30_TAG_PUB_HIS
WHERE FAC_TP = 3
GROUP BY PRD_NO