JSON_EXTRACT_SCALAR

This function Like json_extract(), but returns the result value as a string (as opposed to being encoded as JSON). The value referenced by json_path must be a scalar (boolean, number or string).

Syntax

JSON_EXTRACT_SCALAR(json, json_path)

Example

The following example extracts the 3nd element in the json array:

SELECT  JSON_EXTRACT_SCALAR(JSON_ARRAY(1, 2, 3),'$[2]') json
FROM /shared/examples/ds_orders/tutorial/customers
WHERE customerid = 10
Result: 3