I need to get last six month values from the database. Here is my Fiddle. I need to get the values dynamically. Now February. So I need August to Januar
SELECT *
FROM ratepersqft
WHERE date between date_format(DATE_SUB(CURDATE(), INTERVAL 6 MONTH), '%Y-%m-01')
and date_sub(date_format(CURDATE(), '%Y-%m-01'), interval 1 day);