Oracle DB Common Statements

Source: Internet
Author: User

1.

Altertable table name Add system Time field datedefaultsysdate;--new
altertable Table name MODIFY The field to be modified VARCHAR2 (12);--Modify

2.

The decode () function is one of the most powerful functions of Oracle PL/SQL and is currently available only to Oracle Corporation, and the SQL implementations of other database vendors do not yet have this function

DECODE (Value,if1,then1,if2,then2,if3,then3,..., else), which indicates that if value equals IF1, the result of the DECODE function returns THEN1,..., if it is not equal to any of the If values, The else is returned. At first glance, DECODE can only do equals test, but just see, we can use some function or calculation instead of value, it is possible to make the DECODE function more than, less than or equal to the function.

3.

NVL (string1, Replace_with)

Function: If string1 is null, the NVL function returns the value of Replace_with, otherwise the value of string1 is returned.

By extension, this NVL has the same effect as ISNULL (string1, replace_with) in SQL Server.

The function of NVL2 (E1, E2, E3) is: If E1 is null, the function returns E3 and if E1 is not NULL, E2 is returned.

Oracle DB Common Statements

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.