使用:
SELECT
DATE_SUB(
LAST_DAY(
DATE_ADD(NOW(), INTERVAL 1 MONTH)
),
INTERVAL DAY(
LAST_DAY(
DATE_ADD(NOW(), INTERVAL 1 MONTH)
)
)-1 DAY
) AS firstOfNextMonth,
LAST_DAY(
DATE_ADD(NOW(), INTERVAL 1 MONTH)
)AS lastOfNextMonth