UPPER function
Converts a string to uppercase. UPPER supports UTF-8 multibyte characters, up to a maximum of four bytes per character.
Syntax
UPPER(string)
Arguments
- string
-
The input parameter is a
VARCHAR
string or any other data type, such asCHAR
, that can be implicitly converted toVARCHAR
.
Return type
The UPPER function returns a character string that is the same data type as the
input string. For example, the function will return a VARCHAR
string if the input is a VARCHAR
string.
Examples
The following example uses data from the CATEGORY table in the TICKIT sample database. For more information, see Sample database.
To convert the CATNAME field to uppercase, use the following.
SELECT catname, UPPER(catname) FROM category ORDER BY 1,2;
+-----------+-----------+ | catname | upper | +-----------+-----------+ | Classical | CLASSICAL | | Jazz | JAZZ | | MLB | MLB | | MLS | MLS | | Musicals | MUSICALS | | NBA | NBA | | NFL | NFL | | NHL | NHL | | Opera | OPERA | | Plays | PLAYS | | Pop | POP | +-----------+-----------+