|
|
FULL A - Z Oracle Function Library (formerly named "Morgan's Library")
Term: NVL2
Definition: NVL2(n,x,y) x is alternate value when n is NOT NULL y is alternate value when n is NULL. Note: x and y may have any data type except LONG. The data type of 'x' determines the data type of the output. If it is a character data type, then 'y' is converted to character before comparison, if 'y' is not a constant data. If 'x' is a number, then Oracle casts both 'x' and 'y' to the data type of the higher precedence. Example Usage: The SQL query below displays the message 'JOB' for employees who have a valid JOB ID. For those who don't have a JOB ID assigned, the query displays BENCH. SQL> SELECT EMPNO,JOB, NVL2(JOB, 'JOB', 'BENCH') Related Links: |
Home | Search | Code Library | Sponsors | Privacy | Terms of Use | Contact Us | © 2003 - 2025 psoug.org |