O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required