BINARY is for CHAR and VARCHAR, but he's using TINYTEXT. The binary version of TINYTEXT is TINYBLOB.

Michael

mos wrote:

Paul,
        Just use the "Binary" column attribute to make it case sensitive..

 From MySQL Manual: http://dev.mysql.com/doc/mysql/en/CHAR.html

As of MySQL 4.1, values in CHAR and VARCHAR columns are sorted and compared according to the collation of the character set assigned to the column. Before MySQL 4.1, sorting and comparison are based on the collation of the server character set; you can declare the column with the BINARY attribute to cause sorting and comparison to be case sensitive using the underlying character code values rather then a lexical ordering. BINARY doesn't affect how the column is stored or retrieved.

Mike

At 07:20 AM 8/5/2004, you wrote:

Good morning.
I have a table with field name DATA type tinytext. The table is already
populated. I need DATA to be unique. It seems that MySQL doesn't look at
the uniqueness of a field in a binary fashion.


Example (chosen because I think it is just plain odd)
june = Júne

If I query as -
Select * from myTable where DATA = 'june' - I am returned both.

If I query as
Select * from myTable where cast(DATA as binary) = 'june' - I am returned
only one.

How can I set this table so that the unique key is based on the binary value
of the field? Do I have to alter the field type or is there a better way?


Thank you.

God Bless

Paul C. McNeil
Developer in Java, MS-SQL, MySQL, and web technologies.
Microneil Research
Sortmonster Anti Spam















GOD BLESS AMERICA!
To God Be The Glory!


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to