Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9149219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:26:50+00:00 2026-06-17T11:26:50+00:00

Oracle 11g: Consider the following two CASE Statements SEARCHED CASE with null_table as (select

  • 0

Oracle 11g: Consider the following two CASE Statements

SEARCHED CASE

with null_table as (select null as null_set from dual )
select 
     case 
     when (null_set is null) then 'NULL INDEED'
     else 'NOTNULL?'
     end as AM_I_NULL_OR_NOT   
from null_table

SIMPLE CASE

with null_table as (select null as null_set from dual )
select 
     case null_set
     when  (null) then 'NULL INDEED'
     else 'NOTNULL?'
     end as AM_I_NULL_OR_NOT   
from null_table

The Searched CASE evaluates null_set as expected, yet, Simple CASE appears not to do so.

Questions:
How do I perform a Simple CASE evaluation on null_set ?

Why does the Simple CASE evaluate as it does?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:26:51+00:00Added an answer on June 17, 2026 at 11:26 am

    In Oracle, null cannot be compared against using the = operator.

    For example:

    select * from dual where null = null; -- No result
    select * from dual where 1 = 1; -- gives a result
    

    So what you can do is use NVL to replace null by another value :

    with null_table as (select null as null_set from dual )
    select 
         case nvl(null_set,'X')
         when  'X' then 'NULL INDEED'
         else 'NOTNULL?'
         end as AM_I_NULL_OR_NOT   
    from null_table
    

    (make sure your field can never be equal to the value, X in the example.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Oracle 11g Express, I have the following query: select t1.product_name, SUM(t1.product_cost_per_month) FROM table1
I'm using Oracle 11g Schema I want to select the month and day from
I am usung oracle 11g. Suppose the following query returns n rows. SELECT t.id,t.from_date,t.price
Using .Net and Oracle 11g - I've been returning dataTables from a procedure inside
When using hibernate to retrieve data from Oracle 11g DB using either org.hibernate.dialect.Oracle10gDialect or
Using Oracle 11g release 2, the following query gives an ORA-01790: expression must have
I am using Oracle 11g , and when I try to create a select
I'm Using Oracle 11g database. When i try to access data from db it
I used TOAD for oracle 11g, I want to create an insert script from
Oracle 11g: I want results to list by highest count, then ch_id. When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.