Assume that we have a table like this:
(ID, StartDate, EndDate, SubjectID)
(1, '2018-01-01', '2018-02-01', '1')
(2, '2018-03-01', '2018-04-01', '1')
(n, '2018-06-01', '2018-06-15', '1')
For the specified date (for example '2018-04-04'), i want to check if this date is in any of existing ranges for that subject. How to do this in Mysql? Problem is that number of ranges is variable per subject (we can have 1 to n rows (ranges) per subject).