select * from table where column = something or, when unavailable, column = something else
You can provide a custom ordering, then take the first row, like this: Explanation: The inner select’s order by field(LOCALE, ‘ge’, ‘_’) gets you the rows in the order you define – in this case German first if it exists, then English (you could add more languages to the list). The “trick” here is using mysql’s “non-standard” GROUP … Read more