문제

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!

도움이 되었습니까?

해결책

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)

?

다른 팁

try this

SELECT * 
FROM myTable 
WHERE FIND_IN_SET( email_address, 'foo@bar.com,test@test.com' COLLATE utf8_general_ci );
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top