A single-row function can be nested to any depth. The calculation sequence of nested functions is from the innermost layer to the outermost layer. The following examples show the flexibility of such functions.
A single-row function can be nested to any depth. The calculation sequence of nested functions is from the innermost layer to the outermost layer. The following examples show the flexibility of such functions.
The example shows the last name of an employee in department 60. The calculation of this SQL statement involves the following three steps:
1. The internal function retrieves the first eight characters of the last name.
Result1 = SUBSTR (LAST_NAME, 1, 8)
2. The outer function Concatenates the result with _ US.
Result2 = CONCAT (Result1, '_ us ')
3. the outermost function converts the result to uppercase.
Because the column alias is not given, the entire expression becomes the column title.
Example:
Displays the date of the next Friday six months after the employment date. Sort the results by employment date.
Next 6 Month Review
Bytes -------------------------------------------------------------------------------------
Friday, July 20 th, 2001
Friday, December 13th, 2002
Friday, December 13th, 2002
,