How to compare strings in mysql case sensitiveQuestion: My application includes a query where I want to list all products with a name that starts in upper case. The SQL looked like
.. where prod_name >= 'A' and prod_name <= 'Z';
Turns out this included lowercase products. A further investigation shows
select 'A' = 'a';
returns TRUE (1). How can I make mysql case sensitive?
Answer: Instead of using the = operator, you may want to use LIKE or LIKE BINARY
 | |  | | select 'A' like 'a'
select 'A' like binary 'a'
| |  | |  |
|