How to query dates between two dates in the same column in MySQL
P粉083785014
2023-09-05 21:17:10
<p>I have a table called holiday_master with the following columns</p>
<pre class="brush:php;toolbar:false;">| Id | Title | Date |
|:---|:-------|:------------------------|
| 1 | Christmas | 12-25-2021 - 12-30-2021 |
| 2 | Celebration Festival | 11-30-2021 - 12-02-2021 |</pre>
<p>Suppose I have the current date 2021-12-27, it appears in the first row, I want to get that record, thank you in advance :)</p>
Poor database design can cause many problems. Your database is unavailable.
Date
should be in timestamp or date format split into two columns:start_date
andend_date
Then you can execute