1. NVL
The format of the NVL function is as follows: NVL (EXPR1,EXPR2)
The implication is that if the first parameter of Oracle EXPR1 is empty, then the value of the second parameter is expr2, and if the value of the first parameter expr1 is not NULL, the value of the first parameter is displayed.
2. Nvl2
The format of the NVL2 function is as follows: NVL2 (EXPR1,EXPR2, EXPR3)
The implication is that if the first parameter of the function Expr1 is not empty, then the value of the second argument is expr2, and if the value of the first parameter EXPR1 is null, the value of the third argument is displayed EXPR3.
3. Conversion functions
3.1 To_char () [Converts date and number types to character types]
Date converted to character type:
SelectTo_char (sysdate) s1, To_char (Sysdate,'YYYY-MM-DD') s2, To_char (Sysdate,'yyyy') S3, To_char (Sysdate,'YYYY-MM-DD Hh12:mi:ss') S4, To_char (Sysdate,'Hh24:mi:ss') S5, To_char (Sysdate,' Day') S6 fromDual
Number converted to character type:
Select Sal,to_char (sal,'$99999') N1,to_char (Sal,'$99,999 ' from EMP
3.2 to_date () [Converts a character type to a date type]
Insert into Values (8000, to_date ('2004-10-10','yyyy-mm-dd') ));
3.3 To_number () to numeric type
Select to_number (To_char (sysdate,'hh12'from// number of hours displayed in digital
4. Connection Operator | |
Select ' Hello ' || ' World ' from dual
The output is: HelloWorld
Common functions of Oracle