mysql - is today between two column values

后端 未结 2 1778
渐次进展
渐次进展 2021-01-17 06:28
| id         | first (datetime)    | last (datetime)
--------------------------------------------------------
| 1          | 2013-04-15 00:00:00 | 2013-04-21 23:59:0         


        
相关标签:
2条回答
  • 2021-01-17 06:58
    select *
    from your_table
    where current_date() between first_datetime and last_datetime
    
    0 讨论(0)
  • 2021-01-17 07:01
    select 
        *
    from
        your_table
    where
        first <= NOW() 
    and last >= NOW()
    
    0 讨论(0)
提交回复
热议问题