Hello,
Also ich verstehe das jetzt nicht mehr so ganz..
Dann ist eigentlich eher die Kollation als der Typ wichtig?
Da lesen wir mal zusammen das MySQL-Manual. Ich habe mir das schließlich auch nicht selbst ausgedacht ;-)
Specifying the CHARACTER SET binary attribute for a character data type causes the column to be created as the corresponding binary data type: CHAR becomes BINARY, VARCHAR becomes VARBINARY, and TEXT becomes BLOB. For the ENUM and SET data types, this does not occur; they are created as declared. Suppose that you specify a table using this definition:
CREATE TABLE t
(
c1 VARCHAR(10) CHARACTER SET binary,
c2 TEXT CHARACTER SET binary,
c3 ENUM('a','b','c') CHARACTER SET binary
);
The resulting table has this definition:
CREATE TABLE t
(
c1 VARBINARY(10),
c2 BLOB,
c3 ENUM('a','b','c') CHARACTER SET binary
);
The ASCII attribute is shorthand for CHARACTER SET latin1.
The UNICODE attribute is shorthand for CHARACTER SET ucs2.
The BINARY attribute is shorthand for specifying the binary collation of the column character set. In this case, sorting and comparison are based on numeric character values.
Du brauchst also nur den Spaltentyp "BINARY(x)" oder "VARBINARY(x)" angeben.
Die Binary-Typen haben eine "natürliche" Collation, also eine, die auf den Bytewerten (dem Bitmuster) der eingetragenen Werte beruht.
Liebe Grüße aus dem schönen Oberharz
Tom vom Berg