Unit 4 - Usage of Single-Row Functions to Customize Output
Unit 4 - Usage of Single-Row Functions to Customize Output
Syntax:
function_name [(arg1, arg2,...)]
or
F3(F2(F1(col,arg1),arg2),arg3)
SELECT last_name,
UPPER(CONCAT(SUBSTR(LAST_NAME,1,8),'_RO')) Info
FROM employees
WHERE department_id = 60;
SELECT ROUND(45.923,2),ROUND(45.923,0),ROUND(45.923,-1)
FROM DUAL;
• DUAL is a public table that you can use to view results from functions
and calculations
The RR date format is similar to the YY element, but you can use it to
specify different centuries. Use the RR date format element instead of YY
so that the century of the return value varies according to the specified
two-digit year and the last two digits of the current year. The table in the
slide summarizes the behavior of the RR element.
• Date
• Time
SELECT sysdate
FROM dual;
Which four of the following statements are true about single-row functions?
a. Manipulate data items
b. Accept arguments and return one value per argument
c. Act on each row that is returned
d. Return one result per set of rows
e. May not modify the data type
f. Can be nested
g. Accept arguments that can be a column or an expression
• Creating queries that require the use of numeric, character, and date
functions