Basic query statement for Oracle10g Database-Medium-Function

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.