허접 하지만 이런 방법도 있을거 같아요.
더 좋고 간결한 방법은 고수님들이...
with A AS (
select '20180807' businessDate, 'Y' openYn from dual
UNION ALL
select '20180806' businessDate, 'Y' openYn from dual
UNION ALL
select '20180805' businessDate, 'N' openYn from dual
UNION ALL
select '20180804' businessDate, 'N' openYn from dual
UNION ALL
select '20180803' businessDate, 'Y' openYn from dual
UNION ALL
select '20180802' businessDate, 'Y' openYn from dual
UNION ALL
select '20180801' businessDate, 'Y' openYn from dual
)
SELECT businessDate
FROM (
select businessDate
from A
where businessDate <= '20180807'
and openYn = 'Y'
order by businessDate desc
)
WHERE rownum <= 5;