-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
测试例子如下:
MySQL [test]> select * from a;
+------+-----------------------------------+
| id | data |
+------+-----------------------------------+
| 2 | {"text.abc":"MXCHIP won a prize"} |
| 4 | {"text|abc":"MXCHIP won a prize"} |
| 1 | {"text_abc":"MXCHIP won a prize"} |
| 3 | {"text#abc":"MXCHIP won a prize"} |
+------+-----------------------------------+
4 rows in set (0.01 sec)
MySQL [test]> select get_json_string(data,'$.text_abc') from a;
+---------------------------------------+
| get_json_string(data, '$.text_abc') |
+---------------------------------------+
| NULL |
| NULL |
| MXCHIP won a prize |
| NULL |
+---------------------------------------+
4 rows in set (0.01 sec)
MySQL [test]> select get_json_string(data,'$.text.abc') from a;
+---------------------------------------+
| get_json_string(data, '$.text.abc') |
+---------------------------------------+
| NULL |
| NULL |
| NULL |
| NULL |
+---------------------------------------+
4 rows in set (0.01 sec)
MySQL [test]> select get_json_string(data,'$.text#abc') from a;
+---------------------------------------+
| get_json_string(data, '$.text#abc') |
+---------------------------------------+
| NULL |
| NULL |
| NULL |
| NULL |
+---------------------------------------+
4 rows in set (0.01 sec)
MySQL [test]> select get_json_string(data,'$.text|abc') from a;
+---------------------------------------+
| get_json_string(data, '$.text|abc') |
+---------------------------------------+
| NULL |
| NULL |
| NULL |
| NULL |
+---------------------------------------+
4 rows in set (0.01 sec)