ORACLE functions NVL, NVL2, Nullif

Source: Internet
Author: User

NULL refers to a null value, or an illegal value.

1, NVL (expr1, expr2) function

EXPR1 is null, returns EXPR2, is not NULL, returns EXPR1. Note that the two types should be consistent

Eg:select NVL (column,0) from DUAL--column value is null, it is displayed as 0

2, NVL2 (Expr1, EXPR2, EXPR3)

EXPR1 is not NULL, returns EXPR2, or null, returning EXPR3. EXPR3 will be converted to EXPR2 type if the EXPR2 and EXPR3 types are different

Eg:select NVL2 (column,1,0) The value of the from DUAL--column is not NULL, it is displayed as 1, and if the value of the column name is NULL, it is displayed as 0

3, Nullif (EXPR1, EXPR2)->EXPR1 and expr2 return null, not equal to return EXPR1

ORACLE functions NVL, NVL2, Nullif

Related Article

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.