SELECT day(LAST_DAY('2018-02-01'))

思路:

先通过LAST_DAY() 查找当月最后一天,然后通过day()返回天数.

转载于:https://www.cnblogs.com/lishuaiqi/p/10266533.html