Use of the sign Function and decode function in Oracle

Source: Internet
Author: User

1. Compare the size function SIGN

Sign (x) or Sign (x) is called a symbol function. Its function is to take a certain number of symbols (positive or negative ):
When x> 0, sign (x) = 1;
When x = 0, sign (x) = 0;
When x <0, sign (x) =-1;
X can be a function or computing expression.
 
2. DECODE of the Process Control Function

In logical programming, If-Then-Else is often used for logical judgment. In DECODE syntax, this is actually the logic processing process. Its syntax is as follows:
DECODE (value, if1, then1, if2, then2, if3, then3,... else)
Value indicates any column of any type in a table or any result obtained by calculation. When each value is tested, if the value is if1, the result of the Decode function is then1; if the value is if2, the result of the Decode function is then2; and so on. In fact, multiple if/then pairs can be provided. If the value result is not equal to any given pairing, the Decode result returns else. Here, if, then, and else can both be functions or computing expressions.

Functions, packages, and triggers in Oracle databases

Learning window functions over () in Oracle

Oracle Database random number generation function

Oracle custom functions query data dictionary items

Oracle date functions/character functions/numeric functions/conversion functions/Aggregate functions

Decode () function instructions in Oracle

 

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.