I Have a table which contains information about blockages in a operation for every day of the week in date range. Given that, I need to perform a query which brings only the records that have an active blockage in a given range. E.g.: Suppose there are three registers in the table.
START_DATE END_DATE MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY SUNDAY
2019-01-01 2020-12-31 1 0 0 0 0 0 0
2019-01-31 2019-02-03 0 0 0 0 0 0 1
2018-01-01 2100-12-31 0 0 0 0 0 1 1
And I want to get all the registers which have a blockage between 2019-01-31 and 2019-02-02 (Thursday, Friday and Saturday). The result should bring only the last register. Is there any way of performing this search entirely in the data base using SQL?