Text & patterns
Scalar
lower()
Converts string to lower case.
Arguments & returns
lower(string)
Scalar
| Overload link | string |
Returns |
|---|---|---|
| #01 | VARCHAR |
VARCHAR |
Example
Haybarn WASM 1.5.5-rc3 · In your browser
Engine example · Run to view results.
In a query
Turn a label into a useful key.
Trim the edges, normalize case, and replace runs of spaces. Small functions compose into a readable cleaning step.
Haybarn WASM 1.5.5-rc3 · In your browser
Guide recipe · Run to view results.
In other engines
Used in larger rewrites 1
These examples use lower as one part of a larger SQL translation.
Snowflakeuuid_string()
UUID_STRING('fe971b24-9572-4005-b22f-351e9c09274d', 'foo')
(SELECT LOWER(SUBSTRING(h, 1, 8) || '-' || SUBSTRING(h, 9, 4) || '-' || '5' || SUBSTRING(h, 14, 3) || '-' || FORMAT('{:02x}', CAST('0x' || SUBSTRING(h, 17, 2) AS INT) & 63 | 128) || SUBSTRING(h, 19, 2) || '-' || SUBSTRING(h, 21, 12)) FROM (SELECT SUBSTRING(SHA1(UNHEX(REPLACE('fe971b24-9572-4005-b22f-351e9c09274d', '-', '')) || ENCODE('foo')), 1, 32) AS h))