I have googled aplenty, and can't seem to find a simple solution to my simple use case. I have a json column in an Oracle 12C database (actually a varchar with json constraint of course), and in that column I store a representation of a Map like this
{
"a":9.0847,
"b":859.947
}
In plsql I would like to return a result set of that looks like this
key val
a 9.0847
b 859.947
I have tinkered with seemingly infinite variations of this below, and all the examples are too contrived for my use case.
select b.* from mytable a,json_table(myJsonCol,'$'
columns ( value varchar2(500) path '$.myjsonkey')) b
but this only returns a list of values, without the corresponding keys. The json data is ALWAYS string-double key vals.
thanks
EDIT To add a bit more context, i use json_each in postgres to do this now, and i'm looking for a similar method in Oracle.