title: How to count number of occurrences for all different values in database column?
body: <p>I have a Postgre database that has say 10 columns. The fifth column is called <code>column5</code>. There are 100 rows in the database and possible values of <code>column5</code> are <code>c5value1, c5value2, c5value3...c5value29, c5value30</code>. I would like to print out a table that shows how many times each value occurs. </p>
  
  <p>So the table would look like this:</p>
  
  <pre><code>Value(of column5)          number of occurrences of the value
       c5value1                              1
       c5value2                              5
       c5value3                              3
       c5value4                              9
       c5value5                              1
       c5value6                              1
          .                                  .
          .                                  .
          .                                  .
  </code></pre>
  
  <p>What is the command that does that?</p>