[MySql] Querying Json data type

JSON data type is not exists in oracle, so I have no idea to query json data in mysql. In this article, we will look at how to query JSON column in MySQL.

How to Query JSON column in MySQL

{field_name} -> '$.name' or {field_name} --> '$.name' can extract attribute in json data

mysql> select id,
       details->>'$.name' as browser_str,
       details->'$.name' as browser_name
       from users;
+----+--------------+--------------+
| id | browser_str  | browser_name |
+----+--------------+--------------+
|  1 | "Safari"     |  Safari      |
|  2 | "Chrome"     |  Chrome      |
|  3 | "Firefox"    |  Firefox     |
+----+--------------+--------------+

태그: ,

업데이트:

댓글남기기