文章詳情頁
mysql5.7 json查詢支持
瀏覽:252日期:2022-06-13 18:14:15
問題描述
mysql JSON 查詢
JSON字段內(nèi)容
'[{'id':'1','name':'a'},{'id':'2','name':'b'},{'id':'3','name':'b'}]'
怎么查詢 name=b 的數(shù)據(jù)?
注:我這個是一條數(shù)據(jù), 是個二維數(shù)組轉(zhuǎn)的json
問題解答
回答1:where 字段名 ->’$.name’ = ’name’回答2:
select json_extract(json,’$.name’ ) from table where json_extract(json,’$.name’)= 'b' ;
相關(guān)文章:
1. javascript - sublime快鍵鍵問題2. javascript - immutable配合react提升性能?3. Apache 已經(jīng)把網(wǎng)站根目錄的改為allow from all了,但是服務(wù)器還是不能訪問?4. javascript - 移動端上不能實現(xiàn)拖拽布局嗎?5. 實現(xiàn)bing搜索工具urlAPI提交6. vue.js - Vue 如何像Angular.js watch 一樣監(jiān)聽數(shù)據(jù)變化7. javascript - nodejs關(guān)于進(jìn)程間發(fā)送句柄的一點疑問8. phpstudy8.1支持win11系統(tǒng)嗎?9. 如何解決Centos下Docker服務(wù)啟動無響應(yīng),且輸入docker命令無響應(yīng)?10. css - 寫頁面遇到個布局問題,求大佬們幫解答,在線等,急!~
排行榜

熱門標(biāo)簽
網(wǎng)公網(wǎng)安備