SQLite upper() Function

SQLite upper() function returns a copy of a string with all letter characters converted to uppercase.

Please note that the SQLite built-in implementation of the upper() function only works with ASCII characters, which have a value of less than 128. If you want to use the upper function for the Unicode characters, you use the ICU-based function.

Syntax

Here’s the syntax of the upper() function:

upper(string)Code language: SQL (Structured Query Language) (sql)

Arguments

string

The input string you want to convert to uppercase.

Return Type

TEXT

Examples

The following statement uses the upper() function to return the uppercase form of a string.

SELECT upper('sqlite upper') result;Code language: SQL (Structured Query Language) (sql)

Output:

result
------------
SQLITE UPPER

The following query returns the titles of all albums in the albums table in the uppercase form.

SELECT
  Title,
  UPPER(Title)
FROM
  albums
ORDER BY
  Title;Code language: SQL (Structured Query Language) (sql)

The following picture shows the partial output:

SQLite UPPER Example
Was this tutorial helpful ?