mysql:字段类型为json取值
数据库字段存储的是json类型,只需要其中的⼀个key :
extend
{"XXXX":"xxxx","id":"id","label":"label"}
取id:SELECT extend->>'$.id' FROM tablename;
->:获得的结果带有双引号
->>:获得的结果没有双引号
更多函数:
Table 12.21 JSON Functions
Name Description
(deprecated
Append data to JSON document
5.7.9)
Create JSON array
Append data to JSON document
Insert into JSON array
Return value from JSON column after evaluating path; equivalent to JSON_EXTRACT().
Whether JSON document contains specific object at path
Whether JSON document contains any data at path
Maximum depth of JSON document
Return data from JSON document
Return value from JSON column after evaluating path and unquoting the result; equivalent to
JSON_UNQUOTE(JSON_EXTRACT()).
Insert data into JSON document
Array of keys from JSON document
Number of elements in JSON document
(deprecated
Merge JSON documents, preserving duplicate keys. Deprecated synonym for JSON_MERGE_PRESERVE() 5.7.22)
Merge JSON documents, replacing values of duplicate keys
Merge JSON documents, preserving duplicate keys
Create JSON object
Print a JSON document in human-readable format
Quote JSON document
json值的类型有哪些Remove data from JSON document
Replace values in JSON document
Name Description
Path to value within JSON document
Insert data into JSON document
Space used for storage of binary representation of a JSON document
Type of JSON value
Unquote JSON value
Whether JSON value is valid
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论