Oracle database NULL operation

Source: Internet
Author: User

Null value operation:

  NULL means null.

First, the situation:

1: Any field in the table can be a null value by default.

2:NOT NULL means non-null, a field with a constraint set to a non-null constraint, must have a valid value, and cannot be empty.
3: Insert data when reg:insert into EMP (ENAME,EMPNO) VALUES (2001, ' Zhang San '); In this record, fields that are not assigned are null values.
Reg:insert into EMP (ename,empno) values (2001,null); In this record, the field empno is a null value
4: When modifying data:
     
(1) The null value is the condition
update emp Set ename= ' Zhang San ' where comm is null;
(2) When set to NULL,
Update EMP Set name = NULL;
   
5: null equals infinity 1+null equals null null is not equal to NULL when the empty value participates in the calculation.

  Two, null operation function:

1) NVL (P1,P2) indicates that if the value of P1 This field is null, it is used P2, otherwise p1 is used.

    2) Nvl2 (P1,P2,P3) indicates that if P1 is not null, p2 is used and P3 is used if null.

Tomorrow will give you update DQL language, that is, the use of SELECT, if you have help, then a lot of support I next Ah, like a little attention to it!!!

Oracle database NULL operation

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.