I have the followed data rows:
I'm trying to use JSON_EXTRACT to get rows only if inside jot_locale_vars has index equals "2".
SELECT
jot.*,
(JSON_EXTRACT(`jot_locale_vars`, '$[2]')) as localeVar
FROM job_type jot
WHERE jot_excluded = ''
HAVING localeVar IS NOT NULL
But, as you can see, i've been used $[2]
, but the array indexes start to zero. So... String 1 equals to [0]
, 2 equals [1]
... and i cant use in this way.
How can i extract values if has condition by a string index?