Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use ORDER BY clause on foreign language field

Tags:

sql

select

mysql

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

enter image description here

enter image description here

My question is How could we sort records by foreign language field?

like image 424
PHP Ferrari Avatar asked Dec 24 '12 04:12

PHP Ferrari


People also ask

What is the use of ORDER BY clause explain with example?

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.

Can we use WHERE clause with ORDER BY?

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.

What is use of ORDER BY clause with SQL statement?

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.

Can ORDER BY be used in SELECT statement?

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.


1 Answers

maybe you want to use backtick instead of single quote

SELECT * 
FROM countries 
ORDER BY `name_czech`
like image 185
John Woo Avatar answered Oct 11 '22 20:10

John Woo