1 JSON_CONTAINS('[1,2,3,4,5]','7','$') Returns: 0
2 JSON_CONTAINS('[1,2,3,4,5]','1','$') Returns: 1
1SELECT
2 id, client_id, service_id,
3 json_extract(service_values, '$.quota') AS quota,
4 json_extract(service_values, '$.free_quota') AS free_quota,
5 json_extract(service_values, '$.total_accounts') AS total_accounts,
6 json_extract(service_values, '$.data_transfer') AS data_transfer
7FROM client_services;
1SET @data = '{
2 "Person": {
3 "Name": "Homer",
4 "Hobbies": ["Eating", "Sleeping"]
5 }
6 }';
7SELECT JSON_SET(@data, '$.Person.Name', 'Bart', '$.Person.Hobbies[1]', "Mischief") AS 'Result';
8
1SELECT
2 ID, CITY,
3 json_extract(POPULATION_JSON_DATA, '$.male') AS POPL_MALE,
4 json_extract(POPULATION_JSON_DATA, '$.female') AS POPL_FEMALE,
5 json_extract(POPULATION_JSON_DATA, '$.other') AS POPL_OTHER
6FROM TBL_JSON;