Function: This function is used to process input variables and return a result for data operations. There can be many variables. The input variables can be column values or tables.
Function: This function is used to process input variables and return a result for data operations. There can be many variables. The input variables can be column values or tables.
Function:
The purpose of using a function is to operate data.
Process the input variable and return a result.
There can be many variables.
The input variables can be column values or expressions.
Functions can be nested.
The result of the inner function is the variable of the outer function.
Single-row function: each row has a return value, but multiple variables can exist.
Multiline functions: multiple rows have a return value.
Single Row function classification:
Character operation functions
Numeric operation functions
Date operation functions
Data Type Conversion Function
Comprehensive data type functions
Character operation functions:
Case-sensitive operation functions
Lower, upper, and initcap in upper case
String operation functions
Concat, length, substr, instr, trim, replace, lpad, rpad
Tutorial 12: operate string functions
Character operation functions:
Case-sensitive operation functions
Lower, upper, and initcap in upper case
String operation functions
Concat, length, substr, instr, trim, replace, lpad, rpad
The purpose of this experiment is to master the functions of common string operations.
String case-sensitive operations
SQL> Select lower (ename), upper (ename), initcap (ename) from emp;
SQL> Select lower (ename) lowercase letters, upper (ename) capital letters, initcap (ename) capital letters from emp;
Related reading:
Basic query statement for Oracle 10 Gb database-above
Basic query statement for Oracle 10 Gb database-Medium-Function
Basic query statement for Oracle 10 Gb database-bottom-connection & subquery
SQL> select lower ('mf tr') lowercase letters, upper ('mf tr') capital letters, initcap ('mf tr') capital letters from dual;
Dual is a virtual table. Let's access the function value in the form of a table.
String operation functions
Concat, length, substr, instr, trim, replace, lpad, rpad
Other string operation functions
Concat connects two characters
Select ename, job, concat (ename, job) from emp;
Evaluate the length of a string
The following three sentences are used to determine the length of a string, which must be cited separately.
Select length ('zhang san') from dual; -- follow the word
Select lengthb ('zhang san') from dual; -- byte
Select lengthc ('zhang san') from dual; -- unicode Length