fg

fg

Posts

UPPER

Description:

UPPER returns char, with all letters uppercase. char can be any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2, CLOB, or NCLOB.
The return value is the same datatype as char.

Syntax:

UPPER(char)


Examples:

SELECT employee_id, last_name, department_id
FROM   employees

WHERE  last_name = 'HIGGINS';
0 rows selected

The select statement displays the employee number, name, and department number of employee Higgins.
The WHERE clause specifies the employee name 
as HIGGINS.
Because all the data in the EMPLOYEES table is stored in proper case, the name HIGGINS does not find a match in the table,and no rows are selected.


SELECT employee_id, last_name, department_id
FROM   employees

WHERE  UPPER(last_name)'HIGGINS';


The WHERE clause specifies that the employee name in the EMPLOYEES table is compared to HIGGINS, converting the LAST_NAME column to uppercase for comparison purposes.
Because both names are now uppercase, a match is found and one row is selected.

No comments :

Post a Comment