4 Ways to Use the LIKE Operator in MySQL

When searching for partial strings in MySQL with LIKE you will match case-insensitive by default.

MySQL case-sensitive Search with LIKE

For example, Search all records un members table where name is start with “Pk”.

mysql> SELECT name FROM members WHERE name LIKE 'Pk%';

To do this add BINARY option with like statment and view the results:

mysql> SELECT name FROM members WHERE name LIKE BINARY 'Pk%';

Case 1 − Using BINARY

mysql> select Name like binary 'RAVI' from members;

Case 2 − Without using BINARY

mysql> select Name like 'RAVI' from members;

I hope you get an idea about mysql like case sensitive.


#mysql  #sql  #database 

4 Ways to Use the LIKE Operator in MySQL
1.00 GEEK