PostgreSQL – LOWER Function
The LOWER
function is used to convert all characters in a given string to lowercase. It takes a string as an argument and returns a new string where all alphabetic characters have been converted to their lowercase equivalents.
Here’s the basic syntax of the LOWER
function:
LOWER(string)
string
is the string or column that you want to convert to lowercase.
Here’s an example of using the LOWER
function:
SELECT LOWER('Hello, World!'); -- Returns 'hello, world!'
You can also use the LOWER
function with column values in a table. For instance, if you have a table named employees
with a column named name
, you can convert all last names to lowercase like this:
SELECT LOWER(name) FROM employees;
This query will return a result set with all the name
values in lowercase.