There is a table in which a bunch of lines with translation into different languages. You need to make a selection of the type
SELECT * FROM table WHERE language_id = @language_id but with a rake: not all languages have a translation of the desired string. In this case, you need to get either the first entry, taking into account the importance of the language (for example, ru, en, by, ua, kz , others) or at least just the first entry with a different language_id .
How to implement it?
category.parent_id as parent_category_id,category_descriptionworks. category_id,language.code,category_description.nameFROMcategory_descriptionINNER JOINcategoryONcategory.category_id =category_description.category_id JOINlanguageONlanguage.language_id =category_description.language_id ORDER BYcategory_description.category_id, FIELD (language.code, 'en', " ',' az ') DESC) myViewTable GROUP BY category_i - QuAzI