我得到两列 start_date
和 end_date
。在 MySQL 中是否可以使用 where 子句来过滤这两个字段范围内的特定日期?你能给我提供解决方案吗?
答案 0 :(得分:0)
在 SQL 中,我们有 between
运算符。
SELECT date_to_filter
FROM table_dates
WHERE :date_to_filter_bind BETWEEN start_date AND end_date;
在 :date_to_filter_bind
中输入您想要的日期。