title: How to make a query for each year?
body: <p>I want to make a query for the question: In each year which producer sold the most car? I could write a query where I define the year, but what is the way to list it automatically for each year? </p>
  
  <pre><code>SELECT producer, COUNT(type) AS counter
  FROM `car` 
  INNER JOIN producer ON car.producer= producer.id 
  WHERE produce_year = 2000 
  GROUP BY type 
  ORDER BY COUNT(type) DESC 
  LIMIT 1
  </code></pre>