I have a my_table like this. Col2 is a string type:
| Col1 | Col2 |
|--------------|------------------------------------|
| some_string |{siblings:0, pets:1, have_friends:0}|
| some_string |{siblings:0, pets:0, have_friends:0}|
| some_string |{siblings:1, pets:2, have_friends:3}|
| some_string |{siblings:1, pets:1, have_friends:0}|
I would like to use SQL to parse the key:value pairs on Col2, and filter out pairs where the value is "0" so that the output is:
| Col1 | Col2 |
|--------------|------------------------------------|
| some_string |{pets:1} |
| some_string |{} |
| some_string |{siblings:1, pets:2, have_friends:3}|
| some_string |{siblings:1, pets:1} |
Would someone help?