Skip to content

Coder Tutorial

Menu
  • Home
  • HTML
  • CSS
  • PHP
  • SQL
  • MySQL
  • JS
  • PL/SQL
  • Python
  • Java
  • Oracle
Home
PL/SQL
PL/SQL NVL2

PL/SQL NVL2

Oracle PL/SQL NVL2 Function

The NVL2 function allow us to substitutes a value when a null value is founded as well as when a non null value is founded.

The NVL2 Function syntax:

NVL2( string, value_not_null, value_null )

Example 1:

Select e.empno, e.comm, NVL2(e.comm, 'YES', 'NO') Result From emp e;
Empno Comm Result
7369 NO
7499 300.00 YES
7521 500.00 YES
7566 NO

Example 2:

Select NVL2('', 'YES', 'NO') From dual;

NO

Tutorials

  • PL/SQL Tutorial
  • PL/SQL Blocks
  • PL/SQL Variables
  • PL/SQL Control structures
  • PL/SQL Collections and Records
  • PL/SQL Cursors
  • PL/SQL Stored Procedures
  • PL/SQL Functions
  • PL/SQL Packages
  • PL/SQL Exception Handling
  • PL/SQL Triggers
  • PL/SQL If-Then-Else Statement
  • PL/SQL For Loop
  • PL/SQL While Loop
  • PL/SQL Case Statement
  • PL/SQL Varray
  • PL/SQL Nested Table
  • PL/SQL Indexed Arrays
  • PL/SQL Record
  • PL/SQL Examples
  • Oracle PL/SQL Functions
  • PL/SQL Interview Questions

Recent Posts

  • Java Polymorphism
  • Java Encapsulation
  • Java Abstraction
  • PostgreSQL ERROR: cannot begin/end transactions in PL/pgSQL
  • PostgreSQL Column must appear in the GROUP BY clause
  • PostgreSQL Column specified more than once
  • PostgreSQL Create database, Alter database examples
  • PostgreSQL Create schema syntax, Alter schema
  • PostgreSQL Create database user, alter and drop username
  • PostgreSQL Alter table name. Modify column name
Coder Tutorial Copyright © 2025. | Privacy Policy
Back to Top ↑