Null correlation function

Source: Internet
Author: User
Tags null null

1. NVL (EXPR1,EXPR2) returns EXPR2 if expr is empty

Select nvl (e.commission_pct, one from Employees e;  -- If the bonus is empty, return one

2. NVL2 (EXPR1,EXPR2,EXPR3) returns EXPR3 if EXPR1 returns EXPR2 NOT NULL

Select + 1  One )  from-- +1 If the wage is not empty, returns one by one

3. LNNVL (expr) returns true if expr is false, or if the word blank is judged within expr

  Select *  from Employees e   where > 0.2 -- query bonuses are empty and bonuses are not greater than 0.2 of employee information

4. NANVL (N1,N2)

5.nullif (EXPR1,EXPR2) returns null if EXPR1 equals EXPR2, otherwise returns EXPR1

   Select Nullif (' A ' a 'nullif('a'  'b'from-- query result is empty and a

6. COALESCE (EXPR1,EXPR2 ...) returns the value of the first non-empty expression, with at least two arguments, if no query to non-empty data returns null

Select COALESCE (null NULL null-NULLCOALESCE(nullnull NULL )     from-- query result is 14 and null

Null correlation function

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.