Skip to Main Content

Problem with select connect by

Frank LehmannAug 18 2022

Hi,
i want to have dates for the next 7 days, but only these dates, which are not used in a table.
My select is:
select to_char(sysdate+level-1,'dd.mm.yyyy')
FROM
dual
connect by level <=7
and to_char(sysdate+level-1,'yyyymmdd')
not in (select to_char(startdatum,'yyyymmdd') from t_startdates group by to_char(startdatum,'yyyymmdd') )
When i have dates in this table t_startdates like 18.08.2022 and 19.08.2022 i wished this select shows 20.08.2022 till 25.08.2022 when sysdate = 18.08.2022 !
But the real result is only one date = 18.08.2022 ?
Any hints to solve this ?

This post has been answered by Frank Kulash on Aug 18 2022
Jump to Answer
Comments
Post Details
Added on Aug 18 2022
6 comments
22 views