| Databases InterBase (28) MS-SQL (5) mysql (35) Oracle (1) |
How to compare strings in mysql case sensitive
(1 votes). Leave comments and/ or rate it.
Question: 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
Comments:
|