在MySQL5.7.8之后開始支持一種可高效獲取JSON文本中數(shù)據(jù)的原生JSON類型,該類型具有以下優(yōu)點(diǎn):
另外,系統(tǒng)對(duì)JSON格式做了一些限制:
在插入json數(shù)據(jù)的時(shí)候遇到的問(wèn)題
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘{插入代碼
insert into `players` (`id`,`player_and_games`) values(1,{ "id":1, "name":"aaa", "games_played":{ "Battlefiedld":{ "weapon":"adsf", "level":20 }, "Crazy":{ "weapon":"adsf", "level":20 } }})存在問(wèn)題,json沒(méi)有用引號(hào),正確的方式如下
insert into `players` (`id`,`player_and_games`) values(1,'{ "id":1, "name":"aaa", "games_played":{ "Battlefiedld":{ "weapon":"adsf", "level":20 }, "Crazy":{ "weapon":"adsf", "level":20 } }}')總結(jié)
以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,謝謝大家對(duì)VeVb武林網(wǎng)的支持。
新聞熱點(diǎn)
疑難解答
圖片精選