I have a Postgre database containing around 12 columns. Its fourth column is named column4. The database contains 120 rows and column4 can hold c4entry1, c4entry2, c4entry3...c4entry23, c4entry24. I'd like a printed table giving the frequency of every distinct value.
The resulting table would be something like:
Value(of column4) frequency of that value
c4entry1 2
c4entry2 6
c4entry3 4
c4entry4 8
c4entry5 2
c4entry6 3
. .
. .
. .
Which command would produce that output?