Get the first and last date of next month in MySQL

后端 未结 11 1142
感情败类
感情败类 2020-12-01 03:43

How can I get the first and last day of next month to be used in the where clause?

11条回答
  •  甜味超标
    2020-12-01 04:06

    Shorter query:

    SELECT
    ADDDATE(LAST_DAY(NOW()), 1) AS firstOfNextMonth,
    LAST_DAY(DATE_ADD(NOW(), INTERVAL 1 MONTH)) AS lastOfNextMonth
    

提交回复
热议问题