mysql search value from nested json
P粉366946380
P粉366946380 2023-09-06 14:49:48
0
1
403

I'm trying to search for userId value 22 from nested json in mysql column

My json is

'{
     "data": [
            {"calendarId":"11","userId": "12"},
            {"calendarId":"21","userId": "22"}
           ]
    }'

I tried the following syntax:

1. where JSON_EXTRACT(column_field,'$.userId') = 22

2. where
JSON_EXTRACT(
column_field,
'$.data[*].userId'
) = 22
  1. Also tried using JSON_Table, but didn't get the exact nested json value in the where condition.

P粉366946380
P粉366946380

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!