Parse JSON in MySQL

前端 未结 3 1663
滥情空心
滥情空心 2020-12-16 08:17

I need help on how to parse JSON data in MySQL.

I can parse a column named config containing data such as:

{\"encounterId\":\"f45bf821-98e1-4496-82ef         


        
3条回答
  •  甜味超标
    2020-12-16 08:55

    It appears you are using https://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/get_option.html. It specifies that subdictionaries are not supported, which I think is your problem here.

    Mysql is not a great tool for parsing JSON.

    I think there are some efforts for future versions like 5.7 to start including some support for JSON (see http://blog.ulf-wendel.de/2014/mysql-5-7-http-plugin-mysql/).

    If you are on an earlier version now you might try using UDFs like http://www.slideshare.net/mobile/SvetaSmirnova/mysql-json-functions

    HTH

提交回复
热议问题