w3resource
MySQL Tutorial

PostgreSQL UPPER() function

UPPER() function

The PostgreSQL upper function is used to convert a string from lower case to upper case.

Syntax:

upper(string)

PostgreSQL Version: 9.3

Pictorial Presentation of PostgreSQL UPPER() function

Pictorial presentation of PostgreSQL UPPER() function

Example: PostgreSQL UPPER() function:

In the following example PostgreSQL upper function returns lower case to uppercase.

Code:

SELECT upper('w3resource');

Sample Output:

   upper
------------
 W3RESOURCE
(1 row)

PostgreSQL UPPER() function using Column :

Sample Table: employees.


If we want to display the employee_id, first name, and first_name in upper case for those employees who belong to the department which department_id is 100 from employees table , the following SQL can be executed:

Code:

SELECT employee_id,first_name, 
upper(first_name) "Upper case of first_name" 
FROM employees 
WHERE department_id=100;

Sample Output:

 employee_id | first_name  | Upper case of first_name
-------------+-------------+--------------------------
         108 | Nancy       | NANCY
         109 | Daniel      | DANIEL
         110 | John        | JOHN
         111 | Ismael      | ISMAEL
         112 | Jose Manuel | JOSE MANUEL
         113 | Luis        | LUIS
(6 rows)

New Exercises:R Programming