Skip to content

JSON_SCALAR

SELECT JSON_SCALAR('{"id": 2, "name": "Alice"}', '$.name') AS result;
+--------+
| result |
+--------+
| Alice |
+--------+

The JSON_SCALAR function in the given SQL statement extracts the value associated with the key ‘name’ from the provided JSON object. The output of the function, in this scenario, is ‘Alice’.