Set @a='[
{
"lng": "ch",
"zone_name": "簡體中文",
"zone_location": "A區位置",
"about_zone": "區域描述在這裡輸入"
},
{
"lng": "eng",
"zone_name": "Zone B ENG",
"zone_location": "Zone B Location ENG",
"about_zone": "About Zone EN"
},
{
"lng": "jp",
"zone_name": "ゾーン名はこちら",
"zone_location": "ゾーンの場所はこちら",
"about_zone": "ゾーンの説明はここに入力してください"
},
{
"lng": "es",
"zone_name": "Zone Locatio aquí",
"zone_location": "Nombre de ubicación aquí",
"about_zone": "La descripción debe ingresar aquí sobre nosotros O puede asegurarse de que no haya texto de frenado"
}
]'
I am storing language data in JSON format, trying to fetch name based on user's language i.e if user's preferred language is English then should return English text.
SELECT JSON_EXTRACT (JSON_EXTRACT(@a,'$[3]'),'$.zone_name') ;
any suggest how to fetch data based on "lng" key fyi, will be using in Select query.