So, a problem with MySQL (in my opinion) is that it is not case sensitive by default for VARCHAR fields. That makes getting rid of crappy entries like ’ITALY’ a bother. I mean, sure, I could just post-process it with ruby (see titleize), but what’s the fun in that.
select distinct BINARY(lead_country) from countries;
Ah, finally recognizes that ITALY is not Italy. One is definitely uglier than the other one. Now for the change.
update countries set lead_country = 'Italy' where lead_country = "ITALY";
Much better.

Comments are closed.