Skip navigation links

MySQL Forums :: Character Sets, Collation, Unicode :: good default character set for "english-only" data


Advanced Search

Re: good default character set for "english-only" data
Posted by: Shuichi Tamagawa ()
Date: August 23, 2005 02:46PM

It depends on which you prefer about case sensitivity and sort order.

See the example below and chose what you prefer:

mysql> select col from t where col = 'a' collate latin1_swedish_ci;
+------+
| col |
+------+
| a |
| A |
+------+
2 rows in set (0.00 sec)

mysql> select col from t where col = 'a' collate latin1_bin;
+------+
| col |
+------+
| a |
+------+
1 row in set (0.06 sec)

mysql> select * from t order by col collate latin1_swedish_ci;
+------+
| col |
+------+
| a |
| A |
| b |
| B |
| c |
| C |
+------+
6 rows in set (0.00 sec)

mysql> select * from t order by col collate latin1_bin;
+------+
| col |
+------+
| A |
| B |
| C |
| a |
| b |
| c |
+------+
6 rows in set (0.00 sec)

Note:
You don't need 'collate' clause if you set the collation as default collation.

Options: ReplyQuote


Subject Views Written By Posted
good default character set for "english-only" data 2339 Ajay Sharma 08/21/2005 09:49PM
Re: good default character set for "english-only" data 1958 Shuichi Tamagawa 08/22/2005 02:02PM
Re: good default character set for "english-only" data 3456 Ajay Sharma 08/22/2005 03:34PM
Re: good default character set for "english-only" data 3909 Shuichi Tamagawa 08/23/2005 02:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.