I have some countries name in different languages in MySQL db table, table can support utf8.
But the SELECT * FROM countries ORDER BY 'name_czech'
always sort English alphabatically order
My question is How could we sort records by foreign language field?
The SQL ORDER BY clause is used to sort the data in ascending or descending order, based on one or more columns. Some databases sort the query results in an ascending order by default.
You can use the WHERE clause with or without the ORDER BY statement. You can filter records by finite values, comparison values or with sub-SELECT statements.
The SQL ORDER BY Keyword The ORDER BY keyword is used to sort the result-set in ascending or descending order. The ORDER BY keyword sorts the records in ascending order by default.
SQL queries initiated by using a SELECT statement support the ORDER BY clause. The result of the SELECT statement is sorted in an ascending or descending order.
maybe you want to use backtick instead of single quote
SELECT *
FROM countries
ORDER BY `name_czech`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With