Created
September 29, 2014 11:41
-
-
Save miensol/b589a8e306d8b5755f42 to your computer and use it in GitHub Desktop.
Count elements in json array
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(ja.id), elem.value::varchar from | |
json_answer ja, | |
json_array_elements(ja.answer) as elem | |
group by elem.value::varchar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment