I have a MySql table called contracts. I try to filter contracts applicable between two dates 2022-05-03 and 2022-05-07. MySQL query must be return id numbers: 1
,2
,3
because all record have at least one contract applicable day in filter data. Any pointers into the right direction would be helpful. Thanks!
SELECT id FROM contracts WHERE ...
contracts table
| id | start_date | end_date |
| 1 | 2022-05-01 | 2022-05-04 |
| 2 | 2022-05-06 | 2022-05-10 |
| 3 | 2022-05-01 | 2022-05-10 |
calendar visualisation
| id | 05/01 | 05/02 | 05/03 | 05/04 | 05/05 | 05/06 | 05/07 | 05/08 | 05/09 | 05/10 |
| 1 | x | x | x | x | | | | | | |
| 2 | | | | | | x | x | x | x | x |
| 3 | x | x | x | x | x | x | x | x | x | x |