string

UPPER

Converts a string to uppercase using the current collation/locale. The mirror of LOWER, and equally universal across dialects.

UPPER(string)

Parameters / Modifiers

Parameter Purpose
COLLATE ... Apply a specific locale's uppercase rules
INITCAP Postgres: title-case each word (John Doe)
UCASE MySQL alias of UPPER

Examples

SELECT UPPER('hello');

Returns 'HELLO'

SELECT UPPER(country_code) FROM users;

Normalize ISO country codes to uppercase

SELECT INITCAP('john doe');

Postgres bonus: title-case each word ('John Doe')

SELECT UPPER('ß');

Postgres returns 'SS'; MySQL returns 'ß' (no case mapping)

Dialect notes / Gotcha

MySQL does not fold some multibyte characters that Postgres does (e.g. ß→SS). Wrapping a column in UPPER() bypasses B-tree indexes without a functional index.

Related functions

← All SQL functions · SQL cheat sheet · Window functions · PostgreSQL cheat sheet