How do we filter the records from json?
-
There is a table test. Table 2 has column: id, json_data. This table contains records:
1 {"f_20550": [77, 255, 666]} 2 {"f_20550": [77, 255]} 2 {"f_20550": [77, 66]}
Target: Find all records of which f_20550 properties have element 77.
-
SELECT * FROM test WHERE JSON_CONTAINS( `json_data`, '77', '$.f_20550');