how to find out number of days in month in mysql

date, mysql, sql

Solution

SELECT DAY(LAST_DAY(yourdate))

Problem

I have several dates in mysql tables, using those dates I need to find out the number of days in the month. Suppose i have 2003-02-05 it should return 28. for example ``` date days_in_month 2003-2-3 28 ```

Original source