SELECT 

DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 MONTH), '%Y-%m-01')

, DATE_FORMAT(CURDATE(), '%Y-%m-%d')

FROM DUAL



// 비교

, CASE WHEN

DATE_FORMAT(B.DEL_DATE, '%Y-%m-01') <= DATE_FORMAT(CURDATE(), '%Y-%m-%d') AND DATE_FORMAT(DATE_ADD(B.DEL_DATE, INTERVAL 1 MONTH), '%Y-%m-01') >= DATE_FORMAT(CURDATE(), '%Y-%m-%d') THEN 'Y'

ELSE 'N'

+ Recent posts