Related question: mysql select distinct letters, including extended latin characters
Nobody bothered to reply about the final issue, so I'm creating a new question.
Using this table data: http://pastebin.com/cH2DUzf3
and executing the following query on it:
SELECT DISTINCT BINARY `letter` FROM `texts` ORDER BY `letter` ASC
yields almost perfect results, with one exception: the letter ū is before u. Can anyone explain that? Logically, the letter u is the basic version of ū and the order should be u, ū. Why is it not so? All the other letters are ordered correctly.
Second problem - executing the following statement on the table:
DELETE FROM `texts` WHERE `letter` = 'ū'
deletes also all texts where the letter is u. Why?
Same problem with querying data with Latvian letters:
SELECT * FROM `texts` WHERE `letter` = 'ā'
returns results where letter is a, not ā.
Edit: ok, the last 2 problems can also be solved by putting BINARY before letter.
 
     
    