I have a Json array while looks as below
[{"keyId": "aded5b0107bb5a936604bcb6f", "keyNames": ["abc1, abc2"], "keyDesc": "test"}]
I am using JSON_TABLE to fetch all the values and I have written the following query:
SELECT j.keyId, j.keyNames, j.keyDesc
FROM table t, JSON_TABLE(value, '$[*]'
COLUMNS(
keyId TEXT PATH '$.keyId'
keyNames TEXT PATH '$.keyNames',
keyDesc TEXT PATH '$.keyDesc')
) AS j;
I am getting following output:
keyId keyNames keyDesc
aded5b0107bb5a936604bcb6f NULL test
How to modify the query so as to get the values "abc1, abc2"
for keyNames
instead of NULL
?