MySQL returned an empty result I want to get a data of previous year : 2015-12-01

My Query : 

  SELECT 

          catalog.code,
          Max(catalog.weight) as weight, 
          MONTH(product.created_at) as Month, 
          YEAR(product.created_at) as year

  FROM product 

 LEFT JOIN catalog ON product.code = catalog.code

 WHERE MONTH(product.created_at) = MONTH(2016-01-01 - INTERVAL 1 MONTH) AND YEAR(product.created_at) = year(NOW())

 GROUP BY catalog.code,MONTH(product.created_at),YEAR(product.created_at)


Does anyone have an idea how i can solve this problem?

Thanks for any help.
Your problem is with where condition.

Do have a look at mysql date/datetime formats, this will give you clear idea of how you should use date functions in mysql.

If you need data of previous year, simply change your where condition to:
YEAR(product.created_at) &lt; YEAR(NOW())

Hope this helps!