yves when creating a varchar field in table creation, use the binary. that way, selection is exact. always.
david -----Original Message----- From: Yves Goergen [mailto:[EMAIL PROTECTED] Sent: Monday, March 03, 2008 1:44 PM To: Anders Karlsson Cc: MySQL Subject: Re: Unicode sorting and binary comparison, please! On 03.03.2008 10:27 CE(S)T, Anders Karlsson wrote: > [a lot about why sorting unicode is complicated] > If you want to > accknowledge exact matching, and say any character, accented / > unlauted etc, is different from any other character, specifiy a binary comparison: > SELECT * FROM phonebook WHERE BINARY name = 'Handel'; Hm, not quite compatible. The solution I found is using this: SELECT * FROM table WHERE column = 'value' COLLATE ...; But still there binary collation has a different name on MySQL and SQLite. PostgreSQL doesn't support the COLLATE clause, although part of the SQL-92 standard. But you din't quite get my actual problem. You said that sorting Unicode things is complicated. I agree. I can live with a trade-off for sorting. But I cannot accept incorrect selection of records. When I want something that I can specify exactly, I only want to get that back, nothing else. The same counts for uniqueness constrains. I've asked a freind who could test the matter with PostgreSQL. He said, it works exactly as expected. Sorting is unicode-like, selection is precise. Why can't MySQL do that, too? Is it so hard to distinguish sorting and selecting? -- Yves Goergen "LonelyPixel" <[EMAIL PROTECTED]> Visit my web laboratory at http://beta.unclassified.de -- 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]