MySQL convert string to lowercase
Want to convert your string to lowercase, but don't know how to do it efficiently? We've got you covered.
MySQL convert string to lower case
The trick is that MySQL provides a function, namely LCASE()
, or Lower()
. Both of these can be used to convert a string to lowercase.
Here is an example:
Assume we have a table friends, whose column names contain two records, AHSAN and SUBTAIN.
Now, let's choose our values.
SELECT * FROM friends;
You can see the values in uppercase letters in our column.
Now, we Lower()
convert the column records to lower case using the function.
SELECT LOWER(name) from friends;
This will do the job perfectly. Also, you can LCASE()
replace with Lower()
and it will do the job.
Here’s how:
SELECT LCASE(name) FROM friends;
We can Lower()
use the function with the Where clause. It will convert the value to lowercase and then compare it with the condition.
Here’s how:
SELECT LOWER(name) FROM friends WHERE name = 'AHSAN';
For reprinting, please send an email to 1244347461@qq.com for approval. After obtaining the author's consent, kindly include the source as a link.
Related Articles
Get the version in MySQL
Publish Date:2025/04/24 Views:169 Category:MySQL
-
In this article, we will learn how to get the current version of MySQL on Windows systems. It is necessary for businesses to maintain versions of different tools and software used to run their business in order to keep systems compatible. T
Full Join in MySQL
Publish Date:2025/04/24 Views:70 Category:MySQL
-
This article aims to explore how to perform a full join or full outer join in MySQL. Full outer join is used to merge or combine the entire data from two separate tables. For example, suppose we have two tables named student_id and student_
Grouping by month in MySQL
Publish Date:2025/04/24 Views:166 Category:MySQL
-
In this article, we will learn how to group values by month in MySQL database. Businesses and organizations have to find user or customer data based on purchase or usage trends over a few months. If a particular business achieves its
Enabling the slow query log in MySQL
Publish Date:2025/04/24 Views:177 Category:MySQL
-
Today, we will enable MySQL in MySQL using MySQL shell on Windows and Ubuntu 20.04 slow_query_log . For this tutorial, we are using MySQL version 8.0 and Ubuntu 20.04. MySQL slow_query_log MySQL slow_query_log contains SQL statements that t
Update multiple tables in MySQL with one query
Publish Date:2025/04/24 Views:65 Category:MySQL
-
In some cases, users want to update logically related tables at the same time. These logically related tables are linked to each other through some attributes. Advantages of updating multiple tables in one MySQL query Similar attributes in
Checking MySQL version in macOS
Publish Date:2025/04/24 Views:60 Category:MySQL
-
In this article, we aim to explore how to check the current version of MySQL on macOS. Checking MySQL version in macOS When trying to figure out the version, you must follow these steps. Each time a person logs into the MySQL server, the ve
Common table expressions in MySQL
Publish Date:2025/04/24 Views:168 Category:MySQL
-
This article aims to understand how to use common table expressions in MySQL. Most data analysts need to store the results of different queries in order to merge them with a separate query. With the help of common tables, expressions can ma
Sorting by date in MySQL
Publish Date:2025/04/24 Views:156 Category:MySQL
-
This article aims to understand how to sort values by date in MySQL. Most of the businesses and organizations that use MySQL for data analysis or data visualization need to sort different table values of their users based on dat
Sort MySQL data alphabetically
Publish Date:2025/04/24 Views:153 Category:MySQL
-
In this article, we aim to explore how to sort data alphabetically in MySQL database. Sorting is the ordering of elements or values in an array or column based on a particular criteria. In this tutorial, we will set the criteria as al