2021-09-17
作者:互联网
Mysql JsonArray in 查询
mysql存储JsonArray字符串,使用in查询指定属性信息。
JsonArray文本:
[ { "answerContent":"张三", "topicContentId":501778, "topicId":1502 }, { "answerContent":"23",] "topicContentId":501779, "topicId":1503 }, { "topicContentId":501780, "topicId":1504 } ]
查询sql:
SELECT content FROM answer_content WHERE questionnaire_id = 14 AND JSON_CONTAINS( content ->> '$[*].topicId',JSON_ARRAY(1502,1503),'$')
标签:topicId,17,JsonArray,09,查询,content,2021,topicContentId,1502 来源: https://blog.csdn.net/beer666/article/details/120350406