title: How to COUNT in MySQL with CASE stament
body: <p>I have the following query </p>
  
  <pre><code>SELECT CASE u.situacionUsuario 
      WHEN "A" THEN 'ALTA'
      WHEN "R" THEN 'ALTA'
      WHEN "S" THEN 'ALTA'
      WHEN "B" THEN 'BAJA'
      WHEN "T" THEN 'BAJA'
      ELSE NULL
      END AS Situacion
  FROM Usuario u
  WHERE 
  YEAR(u.fechaAsistencia)=2018 AND MONTH(u.fechaAsistencia) BETWEEN 01 AND 12
  GROUP BY u.situacionUsuario, u.usuario;
  </code></pre>
  
  <p>That return this result</p>
  
  <pre><code>-Situacion-
  |ALTA     |
  |ALTA     |
  |ALTA     |
  |ALTA     |
  |ALTA     |
  |ALTA     |
  |BAJA     |
  |BAJA     |
  |ALTA     |
  |ALTA     |
  |ALTA     |
  |BAJA     |
  |ALTA     |
  |ALTA     |
  |ALTA     |
  ----------
  </code></pre>
  
  <p>And the result that i want is this one. </p>
  
  <pre><code>-Situacion-TOTAL-|
  |ALTA     |12    |
  |BAJA     |3     |
  -----------------
  </code></pre>
  
  <p>I used COUNT but it dosn't return the result i want</p>
  
  <pre><code>SELECT CASE u.situacionUsuario 
          WHEN "A" THEN 'ALTA'
          WHEN "R" THEN 'ALTA'
          WHEN "S" THEN 'ALTA'
          WHEN "B" THEN 'BAJA'
          WHEN "T" THEN 'BAJA'
          ELSE NULL
          END AS Situacion,
      COUNT (CASE u.situacionUsuario 
          WHEN "A" THEN 'ALTA'
          WHEN "R" THEN 'ALTA'
          WHEN "S" THEN 'ALTA'
          WHEN "B" THEN 'BAJA'
          WHEN "T" THEN 'BAJA'
          ELSE NULL
          END) AS Total
      FROM Usuario u
      WHERE 
      YEAR(u.fechaAsistencia)=2018 AND MONTH(u.fechaAsistencia) BETWEEN 01 AND 12
      GROUP BY Situacion;
  </code></pre>
  
  <p>Any suggestion how can i COUNT with the cases and get the desired result?</p>