Changing String Case with UPPER() and LOWER()

Use the UPPER() function to return a string with lowercase letters converted to uppercase, and use the LOWER() function to return a string with uppercase letters converted to lowercase. The UPPER() and LOWER() functions’ important characteristics are:

  • A cased character is a letter that can be lowercase (a) or uppercase (A).

  • Case changes affect only letters; digits, punctuation, and whitespace are left unchanged.

  • UPPER() and LOWER() typically are used to format results and make case-insensitive comparisons in a WHERE clause.

  • Case changes have no effect on empty strings.

  • If its argument is null, UPPER() and LOWER() return null. (But see the Oracle exception in the DBMS Tip in this section.)

To convert ...

Get SQL: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.