support BETWEEN and NOT BETWEEN in subquery