A
A
Alexander2016-02-19 16:53:01
MySQL
Alexander, 2016-02-19 16:53:01

How to search in MySQL 5.7 by JSON type field?

How to correctly form a query to the database to find all records where there is res with id=4
example field value
{
"res": [{"id": 1, "count": 79.307}, {"id": 2, "count ": 64.844}, {"id": 3, "count": 5.643}, {"id": 4, "count": 26.166}]
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor, 2016-02-19
@CooperIII

Read here:
dev.mysql.com/doc/refman/5.7/en/json-search-functi...
This is without going into why you need to store json

S
s0ci0pat, 2016-02-19
@s0ci0pat

If you are using a relational database, use a relational data schema.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question