Some functions oracle collection

coalesce

coalesce (expression_1, expression_2, ...,expression_n)

   Features

     Order traversal expression in parentheses encountered when non-null value returns that value.

    You can solve the problem:

     When dealing with multi-table queries, handle null values.

    For example:

SELECT  '' , ' B ' , ' C '  from Dual;
 SELECT  COALESCE ( '' , ' B ' , ' C ' ) from Dual;   - The first word is empty, returns a null value is not later

the SELECT to_number ( '' ), 0  from Dual          - all expressions of the type of value type must be the first value of 
the SELECT  COALESCE (to_number ( '' ), 0 ) from Dual; - make null value, default 0

 

 

Continued to collect, update ...

Guess you like

Origin www.cnblogs.com/recurision/p/11988388.html