MySQL queries are case insensitive by default, such as:
Select * from where Str =' abc'; select * from some_table where str='abc';
The results are the same, and if we need to differentiate, we can do it as follows:
The first method:
To make MySQL queries case-sensitive, you can:
Select * from where binary Str = ' ABC ' Select * from where binary Str = ' ABC '
The second method:
To be identified when the table is under construction
Create Table some_table ( strchar)
Principle:
For char, varchar, and text types, the binary attribute can assign a collation to a column for that column's character set. The binary property is shorthand for the two-dollar collation of the specified column character set. Sorting and comparisons are based on numeric character values. So the case is also naturally differentiated.
Original link: MySQL query case-insensitive problem
How does "MySQL" resolve query case-insensitive issues in MySQL