How to select only uppercase or lowercase records from mysql table

Posted by & filed under MYSQL.

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'

 

 .

Download Premium Only Scripts & 80+ Demo scripts Instantly at just 1.95 USD per month + 10% discount to all Exclusive Scripts

If you want any of my script need to be customized according to your business requirement,

Please feel free to contact me [at] muni2explore[at]gmail.com

Note: But it will be charged based on your customization requirement

Get Updates, Scripts & Other Useful Resources to your Email

Join 10,000+ Happy Subscribers on feedburner. Click to Subscribe (We don't send spam)
Every Email Subsciber could have access to download 100+ demo scripts & all future scripts.

%d bloggers like this:

Get Instant Script Download Access!