(mysql.info.gz) Charset-collation-effect
Info Catalog
(mysql.info.gz) Charset-collation-charset
(mysql.info.gz) Charset-defaults
10.3.13 An Example of the Effect of Collation
---------------------------------------------
Suppose that column `X' in table `T' has these `latin1' column values:
Muffler
Mu"ller
MX Systems
MySQL
And suppose that the column values are retrieved using the following
statement:
SELECT X FROM T ORDER BY X COLLATE COLLATION_NAME;
The resulting order of the values for different collations is shown in
this table:
`latin1_swedish_ci' `latin1_german1_ci' `latin1_german2_ci'
Muffler Muffler Mu"ller
MX Systems Mu"ller Muffler
Mu"ller MX Systems MX Systems
MySQL MySQL MySQL
The table is an example that shows what the effect would be if we used
different collations in an `ORDER BY' clause. The character that causes
the different sort orders in this example is the U with two dots over
it, which the Germans call U-umlaut, but we'll call it U-diaeresis.
* The first column shows the result of the `SELECT' using the
Swedish/Finnish collating rule, which says that U-diaeresis sorts
with Y.
* The second column shows the result of the `SELECT' using the
German DIN-1 rule, which says that U-diaeresis sorts with U.
* The third column shows the result of the `SELECT' using the German
DIN-2 rule, which says that U-diaeresis sorts with UE.
Three different collations, three different results. That's what MySQL
is here to handle. By using the appropriate collation, you can choose
the sort order you want.
Info Catalog
(mysql.info.gz) Charset-collation-charset
(mysql.info.gz) Charset-defaults
automatically generated byinfo2html