How to search JSON array in MySQL?

后端 未结 8 893
生来不讨喜
生来不讨喜 2020-11-29 06:03

Let\'s say I have a JSON column named data in some MySQL table, and this column is a single array. So, for example, data may contain:

8条回答
  •  抹茶落季
    2020-11-29 06:32

    SELECT JSON_SEARCH('["1","2","3","4","5"]', 'one', "2") is not null 
    

    is true

    SELECT JSON_SEARCH('["1","2","3","4","5"]', 'one', "6") is not null
    

    is false

提交回复
热议问题