mysql 获取当月或指定月的每天

mysql 获取当月或指定月的每天

  • 语句
     	SELECT
      @num:=@num+1 num,
      DATE_ADD(DATE_FORMAT(DATE_ADD(curdate(),interval -day(curdate())+1 day), '%Y-%m-%d'),INTERVAL @num DAY) as days
      FROM
      evt_t_event a,
      (select @num:=-1) num_t
      WHERE
      @num < (SELECT DAYOFMONTH(LAST_DAY(DATE_ADD(curdate(),interval -day(curdate())+1 day))) - 1)
    

mysql 获取当月或指定月的每天_第1张图片

你可能感兴趣的:(mysql)