mysql the last day of the previous month, the last day of the current month

select last_day(DATE_SUB(now(),INTERVAL 1 MONTH)) #The date of the last day of the last month%Y-%m-%d
select last_day(curdate()) #The date of the last day of the month%Y-%m-%d

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326638083&siteId=291194637