Now, I have a mysql query to get the rows from last month where date
is the timestamp column like,
date BETWEEN date_format(NOW() - INTERVAL 1 MONTH, '%Y-%m-01')
AND last_day(NOW() - INTERVAL 1 MONTH);
But the problem is, I am getting only the records of 30 days of the last month. Its working fine for the months with 30 days or lower. But for the months like December I need all the records of 31 days. What will be the correction here? Thanks.