0

So I got JSON and Choice column on MySQL (10.3.15-MariaDB-1:10.3.15+maria~bionic)

This is the JSON =

{"04:17":62,"05:16":31,"06:15":18,"07:14":12,"08:13":8,"09:12":7,"10:11":6}

And the choice is half of the key like 04 / 17 / 08 / 12 etc.

I already try this:

SELECT JSON_EXTRACT('{"04:17":62,"05:16":31,"06:15":18,"07:14":12,"08:13":8,"09:12":7,"10:11":6}','$.08:13'); 

return 8, it's work fine but the value I have only 13...

So

SELECT JSON_EXTRACT('{"04:17":62,"05:16":31,"06:15":18,"07:14":12,"08:13":8,"09:12":7,"10:11":6}','$.13'); 

then it will return null because key is not found.

Is there anyway to search key use like "LIKE"? already try $.%13% or $%.13% {"04:17":62,"05:16":31,"06:15":18,"07:14":12,"08:13":8,"09:12":7,"10:11":6} LIKE '%13%'

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

0 Answers0