DBMS: MySQL 5.6
I have a table tblin which a column jsonstores JSON-like text, a column type text. The column jsonlooks like
{"id": "123", "name": "foo", "age": "20"}
I tried to select lines with a condition json.id = '123'. Failed to complete the request select * from tbl where json like '%"id": "123"%'.
I found that MySQL 5.6 does not support Json functions. So how to use Json in a sentence WHERE?
Append
The layout in which JSON is stored in a single column is definitely not that smart. But I can’t change the scheme, as the business has been working for some time. The MySQL version is not a concern. Therefore, I think a workaround is needed.
source
share