I've got a Postgre database which has say 10 posts. The 5th column is known as column5. You will find 100 rows within the database and possible values of column5 are c5value1, c5value2, c5value3...c5value29, c5value30. I must print a table that shows the number of occasions each value happens.

Therefore the table would seem like this:

Value(of column5)          number of occurrences of the value
     c5value1                              1
     c5value2                              5
     c5value3                              3
     c5value4                              9
     c5value5                              1
     c5value6                              1
        .                                  .
        .                                  .
        .                                  .

What's the command that does that? Thank you for help

Group through the column you are looking at after which use count to obtain the quantity of rows in every group:

SELECT column5, COUNT(*)
FROM table1
GROUP BY column5

Make use of the [cde] clause and also the [cde] aggregate function: