Friday, 1 April 2016

SQL Coalesce

This will return first non-null value.

    Syntax: coalesce (value1, value2, value3 … valuen)         

     Ex:
            SQL> select coalesce(1,2,3), coalesce(null,2,null,5) from dual;

COALESCE(1,2,3) COALESCE(NULL,2,NULL,5)
-------------------       -------------------------------
              1                                            2

No comments:

Post a Comment