Domanda

In MySQL, I can specify the collation if I have a standard WHERE clause like this:

SELECT * FROM myTable WHERE email_address = 'foo@bar.com' COLLATE utf8_general_ci;

However the following fails if I have multiple email addresses in a WHERE-IN clause

SELECT * FROM myTable WHERE email_address IN ('foo@bar.com', 'test@test.com') COLLATE utf8_general_ci;

What am I missing to get this to work? Mysql 5.5.

Thanks!

È stato utile?

Soluzione

What if you specify it after every string:

WHERE email_address IN ('foo@bar.com' COLLATE utf8_general_ci, 'test@test.com' COLLATE utf8_general_ci)

?

Altri suggerimenti

try this

SELECT * 
FROM myTable 
WHERE FIND_IN_SET( email_address, 'foo@bar.com,test@test.com' COLLATE utf8_general_ci );
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top