Checking if a given date fits between a range of dates

前端 未结 3 1560
情歌与酒
情歌与酒 2021-02-07 03:39

If I have 2 date columns in a table, startDate and endDate. How do I return rows where a given date fits between those 2 dates? For example:

3条回答
  •  臣服心动
    2021-02-07 04:35

    Check BETWEEN keyword.

    Syntax is simple:

    SELECT col1, col2
    FROM table1
    WHERE date_col BETWEEN '2012-10-25' and 2012-10-28
    

提交回复
热议问题