I have the following data,
{"value": 0, "action": "UPDATED", "effectiveFrom": "2019-01-31T07:27:13.000Z"}
I am trying to extract the time value using the below SQL,
SELECT CASE
WHEN JSON_EXTRACT(changeData, '$.action') = 'UPDATED' THEN
time(replace(JSON_EXTRACT(changeData, '$.effectiveFrom'), 'T', ' '))
ELSE
'N'
END AS ACTION
FROM change
I used the replace function having read here that for mysql the 'T' should be replaced. My sql is returning null.