What is the best (fastest) approach to compare if the date is in the date range regardless of the year?
date table:
some_column| since | upto | -----------|--------------|-------------| 'foo' | '2011-05-01' | '2013-06-01'|
Now I want this request to return 'foo'
SELECT foo FROM dates WHERE '2014-05-05' BETWEEN `since` AND `upto`
If necessary, I can change the type / format of the stored dates in the "dates" table, but I cannot change the date format that I entered in the query, since this value usually comes from another table (this is part of a more complex query using joins).
source share