Created
January 15, 2013 15:22
-
-
Save kongelaks/4539387 to your computer and use it in GitHub Desktop.
get distribution of array values in a postgres array field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select count(*), unnest("FIELD_NAME") as field from "TABLE" group by field; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dbkaigoaig2h9j=> select count(*), unnest("RENTBASE") as field from aarrets2."Property" group by field;
count | field
-------+--------------------
62 | Full
9 | Partial
16 | Partially Finished
16 | Walkout
24 | Finished
7 | Egress
11 | Crawl
18 | Slab
6 | Daylight
7 | Michigan
(10 rows)