title: How to use CASE in order to alter data retrieved from database
body: <p>Beginner in SQL, I am trying to use <code>CASE</code> to do some conditional operation. </p>
  
  <p>I have a table called <code>MangaTable</code> which contains the details of some Manga (Comics) such as title, author etc. I am trying to <code>GROUP</code> the authors to see how many titles they have like this:</p>
  
  <pre><code>SELECT AUTHOR, COUNT(AUTHOR) FROM MANGATABLE GROUP BY AUTHOR
  </code></pre>
  
  <p>I got the data like this:</p>
  
  <pre><code>"Masashi Kishimoto" | 1
  "Eiichiro Oda"      | 1
  "Tsugumi Ohba"      | 1
  "Kubo Tite"         | 2
  </code></pre>
  
  <p>But instead of numbers I want to display "Single" or "Multiple". 
  I tried this:</p>
  
  <pre><code>SELECT AUTHOR, COUNT(AUTHOR) AS CAL, CASE WHEN CAL&gt;1 THEN 'MULTIPLE' ELSE 'SINGLE' END FROM MANGATABLE GROUP BY AUTHOR
  </code></pre>
  
  <p>But I am getting an Error: <code>column "cal" does not exist</code></p>
  
  <p>Please advice. </p>