How to select only uppercase or lowercase records from mysql table

The table A contains following two records ‘111a’ and ‘111A’, if you want to select only ‘111A’ record using following those queries it will outputs both the records instead outputting single records. Queries are SELECT * FROM table_A WHERE value…

0
How to select only uppercase records from mysql table

The table A contains following two records ‘111a’ and ‘111A’, if you want to select only ‘111A’ record using following those queries it will outputs both the records instead outputting single records.

How to select only uppercase records from mysql table

Queries are

SELECT * FROM  table_A WHERE value =  '111A'

SELECT * FROM  table_A WHERE value LIKE '%A'

Output are

How to select only uppercase records from mysql table
MySql Table Output

Here is the solution to select only uppercase or lowercase letter records from your table. In the below sql query the BINARY operator casts the string following it to a binary string. This is an easy way to force a comparison to be done byte by byte rather than character by character in where condition.

Query

SELECT * FROM  table_A WHERE binary value =  '111A'

Output

How to select only uppercase records from mysql table

Query

SELECT * FROM  table_A WHERE binary value =  '111a'

Output

SELECT value FROM data WHERE BINARY value = '111A'

 

 .