SELECT *
FROM (
SELECT TMP., ROWNUM AS ROW_ID
FROM (
SELECT *
FROM (
SELECT base., ROW_NUMBER() OVER (PARTITION BY base.BIZID ORDER BY base.ORDER_NUM DESC, base.ID DESC) AS RN
FROM BASE_SYS_FAQ base
LEFT JOIN BASE_SYS_FAQ_ORG org ON base.bizid = org.FAQ_ID
AND org.MOF_DIV_ID = '1c0a58de5a704cce8c6ee8bf06844278'
WHERE base.PUB_DATE >= to_date(to_char('2021-07-16 00:00:00.0', 'yyyy-mm-dd') || ' 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
AND base.PUB_DATE <= to_date(to_char('2021-07-17 00:00:00.0', 'yyyy-mm-dd') || ' 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
AND base.IS_DELETED = 0
AND base.MOF_DIV_ID = '1c0a58de5a704cce8c6ee8bf06844278'
ORDER BY base.ORDER_NUM DESC, base.ID DESC
)
WHERE RN = 1
) TMP
WHERE ROWNUM <= 20
)
WHERE ROW_ID > 0