Convert Uppercase Characters to Lowercase to Compare Data in MySQL

A database is a collection of information that is organized in a meaningful way. A MySQL Database stores data and retrieves it easily when needed. What does this mean for you? It means your business can grow faster without the need to worry about how fast your system will be able to handle the increase in volume! MySQL offers many functions to help query data faster and easier. Lower() and Lcase() are 2 methods which we will introduce in this post.

MySQL offers LOWER() function which can convert a field’s characters to lowercase. Besides, we can use the LCASE() function, which is a synonym for LOWER().

Syntax:

LOWER(str)
LCASE(str)

Usage:

//convert a field's value to lowercase
SELECT LOWER(post_title) FROM `wp_posts`
SELECT LCASE(post_title) FROM `wp_posts`
//convert any string
SELECT LOWER('Uppercase')
SELECT LCASE('Uppercase')

Leave a Comment

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close