Preamble
Oracle/PLSQL NULLIF function compares expr1 and expr2. If expr1 and expr2 are equal, the function NULLIF returns NULL. Otherwise, it returns expr1.
Oracle/PLSQL syntax of the function NULLIF
NULLIF( expr1_id, expr2_id )
Parameters or arguments
- expr1_id and expr2_id must either have numerical values or values that have the same data type.
Note:
- The function NULLIF returns NULL if expr1_id and expr2_id are equal.
- The function NULLIF returns expr1 if expr1_id and expr2_id are not equal.
- expr1 can be an expression which is evaluated as NULL but cannot be literal NULL.
The function NULLIF can be used in the following versions of Oracle/PLSQL
|
Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i
|
Let’s consider some examples of Oracle NULLIF function and learn how to use NULLIF function in Oracle PLSQL.
SELECT NULLIF(12, 12) AS RESULT FROM DUAL;
-result: NULL
SELECT NULLIF(12, 13) AS RESULT FROM DUAL;
-result: 12
SELECT NULLIF('apples', 'apples') AS RESULT FROM DUAL;
-RESULT: NULL
SELECT NULLIF('apples', 'oranges') AS RESULT FROM DUAL;
-RESULT: apples
SELECT NULLIF(NULL, 12) AS RESULT FROM DUAL;
SELECT NULLIF(NULL, 12) AS RESULT FROM DUAL
ORA-00932: inconsistent datatypes: expected - got CHAR
-- ORA-00932 error because expr1 can't be literal NULL
NULLIF FUNCTION IN ORACLE SQL WITH EXAMPLE
About Enteros
Enteros offers a patented database performance management SaaS platform. It proactively identifies root causes of complex business-impacting database scalability and performance issues across a growing number of clouds, RDBMS, NoSQL, and machine learning database platforms.
The views expressed on this blog are those of the author and do not necessarily reflect the opinions of Enteros Inc. This blog may contain links to the content of third-party sites. By providing such links, Enteros Inc. does not adopt, guarantee, approve, or endorse the information, views, or products available on such sites.
Are you interested in writing for Enteros’ Blog? Please send us a pitch!
RELATED POSTS
Governing AI Performance in Technology Enterprises: Enteros GenAI-Driven Intelligence Platform
- 26 January 2026
- Database Performance Management
Introduction Artificial Intelligence has moved from experimentation to the core of modern technology enterprises. AI now powers customer experiences, revenue optimization, fraud detection, personalization engines, autonomous operations, developer productivity tools, and mission-critical decision systems. From SaaS platforms and digital marketplaces to enterprise software and AI-native startups, organizations are embedding AI into nearly every layer of … Continue reading “Governing AI Performance in Technology Enterprises: Enteros GenAI-Driven Intelligence Platform”
Optimizing Healthcare Databases at Scale: How Enteros Aligns GenAI, Performance Intelligence, and Cloud FinOps
Introduction Healthcare organizations are under unprecedented pressure to deliver better patient outcomes while operating within increasingly constrained financial and regulatory environments. Hospitals, payer networks, life sciences companies, and digital health platforms now rely on massive volumes of data—electronic health records (EHRs), imaging repositories, genomics pipelines, AI-driven diagnostics, claims systems, and real-time patient monitoring platforms. At … Continue reading “Optimizing Healthcare Databases at Scale: How Enteros Aligns GenAI, Performance Intelligence, and Cloud FinOps”
Governing Cloud Economics at Scale: Enteros Cost Attribution and FinOps Intelligence for BFSI and Technology Organizations
- 25 January 2026
- Database Performance Management
Introduction Cloud adoption has become foundational for both BFSI institutions and technology-driven enterprises. Banks, insurers, fintechs, SaaS providers, and digital platforms now depend on cloud-native architectures to deliver real-time services, enable AI-driven innovation, ensure regulatory compliance, and scale globally. Yet as cloud usage accelerates, so does a critical challenge: governing cloud economics at scale. Despite … Continue reading “Governing Cloud Economics at Scale: Enteros Cost Attribution and FinOps Intelligence for BFSI and Technology Organizations”
Turning Telecom Performance into Revenue: Enteros Approach to Database Optimization and RevOps Efficiency
Introduction The telecom industry is operating in one of the most demanding digital environments in the world. Explosive data growth, 5G rollout, IoT expansion, cloud-native services, and digital customer channels have fundamentally transformed how telecom operators deliver services and generate revenue. Behind every call, data session, billing transaction, service activation, roaming event, and customer interaction … Continue reading “Turning Telecom Performance into Revenue: Enteros Approach to Database Optimization and RevOps Efficiency”