I'm using MySQL 5.6.43 and trying to search through in JSON array in a table. My JSON in MySQL database is like this:
[
{
"Name": "AAA",
"CountryCode": "AFG",
"District": "Kabol",
"Population": 1780000
},
{
"Name": "BBB",
"CountryCode": "AFG",
"District": "Qandahar",
"Population": 237500
},
{
"Name": "CCC",
"CountryCode": "USD",
"District": "Qandahar",
"Population": 237500
}
]
I want to take the just AFG CountryCode's. So my result should be like this:
[
{
"Name": "AAA",
"CountryCode": "AFG",
"District": "Kabol",
"Population": 1780000
},
{
"Name": "BBB",
"CountryCode": "AFG",
"District": "Qandahar",
"Population": 237500
}
]
How can I achieve that?