I have created a table in a MySQL database that stores a text field:
CREATE TABLE 'Usuarios' (
'Id' int(11) unsigned NOT NULL AUTO_INCREMENT,
'Nombre' varchar(50) DEFAULT NULL,
PRIMARY KEY ('Id')
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
I have entered 2 names: José and jose
And from Java I do a search query that tells me that I have two identical records:
ResultSet resultado = consulta.executeQuery("SELECT COUNT(*) FROM 'Usuarios' WHERE UPPER('Nombre') = ‘JOSÉ’";
resultado.first();
System.out.println("Usuarios llamados JOSÉ: " + resultado.getInt(1));
ANSWER: Users called JOSÉ: 2
How can I avoid treating accented and unstressed vowels equally?