title: Sql count distinct values based on column
body: <p>I need an help about a sql query. I have a table as the following</p>
  
  <pre><code>error   session
  error1     1 
  error1     1
  error2     1
  error1     2
  error1     2
  error2     2
  </code></pre>
  
  <p>I have to count errors once related to session. The result should be</p>
  
  <pre><code>error   number of errors     
  error1         2
  error2         2
  </code></pre>
  
  <p>Thank you</p>