0

Key in database:- !|%$&./()=?ì^

If I use below query:-

SELECT * FROM `user` WHERE key='!|%$&./()=?ì^' AND Status='1'

This works fine.

But I am checking for case sensitive key(some users using case sensitive keys) with below query:-

SELECT * FROM `user` WHERE BINARY key ='!|%$&./()=?ì^' AND Status='1'

This does not provide any data. On removing ì, this works.

key field collation: latin1_swedish_ci

Note:- I can not change collation because there are too much data in database.

What else I can use in place of BINARY.

Deepak Dholiyan
  • 1,774
  • 1
  • 20
  • 35

1 Answers1

0

I find a best answer on the below link:-

https://stackoverflow.com/a/56283818/5346525

use convert as well as collate

New Query:-

SELECT * FROM `user` WHERE key = convert('!|%$&./()=?ì^' using latin1) COLLATE latin1_general_cs AND Status='1'
Deepak Dholiyan
  • 1,774
  • 1
  • 20
  • 35