I have a classifier column that can have value of X or Y. My select query has to filter by date taking into account if the column has x or y.
date BETWEEN i.valid_fromX AND i.valid_toX
date BETWEEN i.valid_fromY AND i.valid_toY
Essentially I need the equivalent of the following in SQL:
if classifier == X {
check if date is between valid_fromX to valid_toX
} else if classifier == Y {
check if date is between valid_fromY to valid_toY
}