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