fg

fg

Posts

INITCAP

Description:


INITCAP returns char, with the first letter of each word in uppercase, all other letters in lowercase. Words are delimited by white space or characters that are not alphanumeric.
char can be any of the datatypes CHAR, VARCHAR2, NCHAR, NVARCHAR2.
The return value is the same datatype as char.

Syntax:
INITCAP(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  last_name = INITCAP('higgins');



The WHERE clause specifies that the employee name in the EMPLOYEES table is compared to INITCAP('higgins') which equal 'Higgins'.

Because both names are now 'Higgins', a match is found and one row is selected.

No comments :

Post a Comment