fg

fg

Posts

Concatenation Operator

Description:
You can link columns to other columns, arithmetic
expressions, or constant values to create a character 
expression by using the concatenation operator (||).

If you concatenate a null value with a character 
string, the result is a character string.
LAST_NAME || NULL results in LAST_NAME.

Examples: 

SELECT  last_name||job_id AS "Employees"
FROM   employees;
The select statement displays LAST_NAME and 
JOB_ID are concatenated, and given the alias 
Employees. Note that the last name of the 
employee"Abeland the job code"SA_REP" are 
combined to make a single output Column 


"AbelSA_REP".
SELECT last_name ||': 1 Month salary = '||salary Monthly
FROM   employees;



The select statement displays the last names and 
job codes of all employees. The column has the 
heading Employee Details. Note the spaces between
the single quotation marks in the SELECT 
statement.
The spaces improve the readability of the output. 
 

No comments :

Post a Comment