Cast COLLATE : Collate « I18N « SQL / MySQL

Home
SQL / MySQL
1.Aggregate Functions
2.Backup Load
3.Command MySQL
4.Cursor
5.Data Type
6.Database
7.Date Time
8.Engine
9.Event
10.Flow Control
11.FullText Search
12.Function
13.Geometric
14.I18N
15.Insert Delete Update
16.Join
17.Key
18.Math
19.Procedure Function
20.Regular Expression
21.Select Clause
22.String
23.Table Index
24.Transaction
25.Trigger
26.User Permission
27.View
28.Where Clause
29.XML
SQL / MySQL » I18N » Collate 
Cast COLLATE
   
mysql>
mysql> CREATE TABLE LETTERS
    ->    (SEQNO    INTEGER NOT NULL PRIMARY KEY,
    ->     LETTER   CHAR(1CHARACTER SET UTF8 NOT NULL)
    -> ;
Query OK, rows affected (0.00 sec)

mysql> -- insert data ;

mysql> SELECT   LETTER, COUNT(*)
    -> FROM    (SELECT   LETTER COLLATE latin2_czech_cs AS LETTER
    ->          FROM     LETTERSAS LATIN2_CZECH_LETTERS
    -> GROUP BY LETTER
    -> ;
ERROR 1253 (42000): COLLATION 'latin2_czech_cs' is not valid for CHARACTER SET 'utf8'
mysql> SELECT   LETTER, COUNT(*)
    -> FROM    (SELECT   LETTER COLLATE latin2_croatian_ci AS LETTER
    ->          FROM     LETTERSAS LATIN2_CROATIAN_LETTERS
    -> GROUP BY LETTER;
ERROR 1253 (42000): COLLATION 'latin2_croatian_ci' is not valid for CHARACTER SET 'utf8'
mysql>
mysql> drop table letters;
Query OK, rows affected (0.00 sec)

mysql>

   
    
    
  
Related examples in the same category
1.Set COLLATE=latin1_german1_ci
2.ORDER BY and COLLATE latin1_german2_ci
3.ALTER TABLE employee MODIFY employee VARCHAR(60) CHARACTER SET latin1 COLLATE latin1_german2_ci;
4.ORDER BY CONVERT(firstname USING utf8) COLLATE utf8_polish_ci;
5.SELECT firstname FROM employee ORDER BY firstname COLLATE latin1_general_ci
6.SELECT firstname FROM employee ORDER BY firstname COLLATE latin1_german1_ci
7.SELECT firstname FROM employee ORDER BY firstname COLLATE latin1_swedish_ci
8.SELECT firstname FROM employee ORDER BY firstname COLLATE utf8_general_ci
9.COLLATE sort operator allows you ro specify a collation in your expression.
10.Create database with character set and collate
11.Change the character set name and collate name for database
12.Change collate for database
13.COLLATE utf8_romanian_ci for column definition
14.Set the character set and collate for a table
15.COLLATE 'latin1_danish_ci'
16.ORDER BY a column COLLATE latin1_swedish_ci
17.Order by collate
18.Alter table to change the collate setting
19.Check the collation name
20.Get collation
21.ERROR 1267 (HY000): Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_danish_ci,IMPLICIT) for operation '='
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.