[SQL] 纯文本查看 复制代码
INSERT INTO emp_details(emp_no, details)
VALUES ('1',
'{ "location": "IN", "phone": "+11800000000",
"email": "abc@example.com", "address": { "line1":
"abc", "line2": "xyz street", "city": "Bangalore",
"pin": "560103"} }'
);
[SQL] 纯文本查看 复制代码
mysql> select emp_no,json_pretty(details) from emp_details\G;
*************************** 1. row ***************************
emp_no: 1
json_pretty(details): {
"email": "abc@example.com",
"phone": "+11800000000",
"address": {
"pin": "560103",
"city": "Bangalore",
"line1": "abc",
"line2": "xyz street"
},
"location": "IN"
}
1 row in set (0.00 sec)
mysql> select emp_no,details from emp_details;
+--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| emp_no | details |
+--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 1 | { "location": "IN", "phone": "+11800000000",
"email": "abc@example.com", "address": { "line1":
"abc", "line2": "xyz street", "city": "Bangalore",
"pin": "560103"} } |
+--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)