So the idea is very simple :
I have a table containing a start_date and end_date columns .
I also have 2 parameters (initial_date, final_date).
I want to check of my daterange [initital_date, final_date] has an intersection within any possible combination of the [start_date, end_date] daterange.
for example, if I have this following table :
id | start_date | end_date
1 '2022-05-23' '2022-05-26'
2 '2022-05-25' '2022-05-30'
3 '2022-05-01' '2022-05-20'
and if initial_date = 2022-05-19 and final_date = 2022-05-24
my desired output would be:
id | start_date | end_date
1 '2022-05-23' '2022-05-26'
3 '2022-05-01' '2022-05-20'