LOWER
Functions › Text › Case and length
Returns a string with every letter in lower case.
Syntax
LOWER( <string> )
Arguments
| Argument | Description |
|---|---|
<string> | The text to convert. A number, boolean or date is converted as its text. |
Returns
Text. NULL when <string> is NULL.
Usage notes
- Letters outside ASCII are converted too:
LOWER('ÉCOLE')isécole. - Use it to compare text without regard to case.
ILIKEdoes the same for a pattern. - On large tables the engine runs it in the data store, in the select list and in
WHERE.
Examples
SELECT c.key, LOWER(c.email) AS email
FROM Customer c
WHERE LOWER(c.email) LIKE '%@example.com'
| key | |
|---|---|
| C-104 | ana.ruiz@example.com |
| C-221 | j.smith@example.com |
Group names that differ only in case:
SELECT LOWER(a.name) AS name, COUNT(*) AS accounts
FROM tables.crm.account a
GROUP BY LOWER(a.name)
HAVING COUNT(*) > 1
| name | accounts |
|---|---|
| northwind traders | 2 |