How to search JSON data in MySQL?

By | January 30, 2019

If you have JSON type columns in your database and want to run query on JSON type field. You can use the following query.

SELECT JSON_EXTRACT('<json_column>', "$.response") AS name
FROM table
WHERE JSON_EXTRACT('<json_column>', "$.id") > 3

In the above query <json_column> must be replace by your column name.

$.id and $.response contains the JSON key of your columns. You can use for multiple values also.

For example : $

Leave a Reply

Your email address will not be published. Required fields are marked *