I have a json array column, foo:
[{"a": "my_key_type", "b": "foo"}]
[{"a": "my_other_key_type", "b": "foo"}]
[]
[{"a": "my_key_type", "b": "bar"}, {"a": "my_other_key_type", "b": "baz"}]
I would like to select into an array all a values for each JSON element in the column. For instance:
['my_key_type']
['my_other_key_type']
[]
['my_key_type','my_other_key_type']
I was initially pursuing json_object_keys, but that doesn't seem to accomplish what I'm actually after, and it doesn't work on an array type. I have not found a function in the documentation that seems to accomplish what I'm after.