如何通过提供月份和年份作为输入来获取 MySQL 中月份的最后一天。
Similar example, To get last day of the month by date as input
Eg: SELECT LAST_DAY(?) as lastDate
Format:
Input month and year: '07/2015'
Output Result: day /*Eg: 30,31*/
Run Code Online (Sandbox Code Playgroud)
我已经尝试过日期格式,
SELECT LAST_DAY(DATE_FORMAT('09/2015','%m/%Y')) as lastDate但它不起作用