title: MySQL group by different values in same column
body: <p>I want to group the output by year so that I have 2 rows. One row for count in 2019 and one row for count in 2020. Is it even possible? Is there a similar output variant?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>select count(*)
       , leirueck 
    from ausleihe 
   where leirueck between "2019-02-01" and "2019-02-10" 
      or leirueck between "2020-02-01" and "2020-02-10" 
   group  
      by leirueck 
  </code></pre>
  
  <p>And here the output</p>
  
  <pre><code>count(*) leiruck
        17 2019-02-02
        37 2019-02-04
        16 2019-02-06
        20 2019-02-07
        21 2019-02-09
        47 2020-02-01
        17 2020-02-02
        57 2020-02-03
        37 2020-02-04
        16 2020-02-06
        20 2020-02-07
       105 2020-02-09
  </code></pre>