upper Function

The upper function converts all the characters in a string to uppercase.

Syntax

returnvalue upper (source)

source ::= any*
returnvalue ::= string

Semantics

source

The input string that should be converted to uppercase. This argument is implicitly cast to a sequence of strings.

returnvalue

Returns NULL if the source argument is NULL.

Returns NULL if the source argument is an empty sequence or a sequence with more than one item.

Note: If you want to convert a sequence with more than one item, see the Sequence Transform Expressions section.

Example 1 - upper Function

In this example, the lastname field is converted to uppercase.

SELECT id, firstname, upper(lastname) FROM users

Output:

+----+-----------+----------+
| id | firstname | Column_3 |
+----+-----------+----------+
| 10 | John      | SMITH    |
| 20 | Mary      | ANN      |
| 30 | Peter     | PAUL     |
+----+-----------+----------+