首页 > 解决方案 > MYSQL JSON Query with keys conditions

问题描述

I have a JSON column in a MYSQL table, I want to retrieve data from specific keys Where KEY is in an array of keys

For instance: My table name is functionalities This is my config column with JSON datatype:

{
 "show_image": 
       {
         "label": "Show Client Image", 
         "ui-elements": [".field-type-imagge"]
       }, 
 "view_balance": 
       {
         "label": "View Client Balance", 
         "ui-elements": ["#profile-page-about-details"]
       }
}

I want to select only the data for key name "show_image"

Something like this:

SELECT json_key FROM functionalities WHERE json_key IN ('show_image')

I'm USING MYSQL 5.7.22

How Can I do it?

Thanks

标签: mysqljsonkey

解决方案


推荐阅读