In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following content mainly brings you a brief analysis of the operation of MySQL 5.7Json. The knowledge mentioned here, which is slightly different from books, is summed up by professional and technical personnel in the process of contact with users, and has a certain value of experience sharing, hoping to bring help to the majority of readers.
Create a tabl
CREATE TABLE t_json (id INT PRIMARY KEY, NAME VARCHAR (20), info JSON)
Insert record
INSERT INTO t_json (id,sname,info) VALUES (1, 'test',' {"time": "2017-01-01 13:00:00", "ip": "192.168.1.1", "result": "fail"}'); INSERT INTO t_json (id,sname,info) VALUES (2, 'my',JSON_OBJECT ("time", NOW (),' ip','192.168.1.1','result','fail'))
Query IP key
SELECT sname,JSON_EXTRACT (info,'$.ip') FROM t_json
Query how many keys there are
SELECT id,json_keys (info) AS "keys" FROM t_json
Delete key
UPDATE t_json SET info = json_remove (info,'$.ip')
Add key
UPDATE t_json SET info = json_set (info,'$.ip','192.168.1.1')
Change value
UPDATE t_json SET info = json_set (info,'$.ip','192.168.1.2')
For the above brief analysis of MySQL 5.7Json operation, if you need to know more, you can continue to pay attention to the innovation of our industry, if you need to get professional answers, you can contact the pre-sale and after-sale on the official website. I hope this article can bring you some knowledge updates.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.