I'm using postgres with a jsonb field that looks something like this:
{[[1.2, 'blah'], [3.4, 'blahhh']}
I'm extracting the numbers by using:
jsonb_path_query_array(json_row, '$[*]')
Which gives the
jsonb
object [1.2, 3.4]
. I'm now trying to find the maximum of this array to no avail. I've tried using jsonb_array_elements
, but this seems only to somehow truncate the array, returning a single element.
So, how can I get the maximum of a jsonb
array? preferably, this would be done without the use of a subquery.
Asked by Nathaniel Bubis
(101 rep)
Jul 6, 2023, 12:10 PM
Last activity: Jul 6, 2023, 12:35 PM
Last activity: Jul 6, 2023, 12:35 PM