Common functions in Oracle

Source: Internet
Author: User

1. NVL (column, default) function handles NULL

Select NVL (null,3), NVL (4,3) from dual results shown as 3, 4. Because the first of the NVL is null, the result is the second value, the first one is not empty, and the result is the first value

Select SAL+NVL (comm,0) *12 some comm fields in the From dual table are null

2, NVL (column, return result 1 (column is not empty), return result 2 (listed as empty))

3,, nullif (expression 1, expression 2) function

Returns null if two expressions are equal, otherwise 1

4, Decode (column, value 1, output result 1, value 2, Output 2, ....) if the column is equal to which value, it outputs which result

5, COALESCE (expression 1, expression 2, expression 3, ..... ) function

The expression is 1 bits null, the value of expression 2 is displayed, if Expression 2 is also empty, the value of expression 3 is displayed, and so on

Common functions in Oracle

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.