What is the result, when NULL is compared with NULL?
Answer Posted / gaurav arora
The answer-6 is quite matching with my stuff. Let me clear
it in more writting:
1. When we compare two nulls then the result
always 'false'. The main reason is the null is not a value
its neither an empty nor a empty space, so the actual
result is null which places as null.
2. When we compare a null with another which has some value
like some int value then the result is false. The actual
result is false and not null.
Consider the following examples:
--null = null is null which is false
Declare @intNull1 int
Set @intNull1 =null
Declare @intNull2 int
Set @intNull2=null
If @intNull1=@intNull2
Print 'null = null is true'
Else
Print 'null = null is false'
--Now assign some value
Set @intNull1 = 1
If @intNull1=@intNull2
Print 'null = int value is true'
Else
Print 'null = int value is false'
Thanks,
Gaurav Arora
http://stuff4mdesktop.blogspot.com/
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
Why do we need pl sql?
What is a primary key? Explain
How many types of sql are there?
How do you concatenate in sql?
what are the security recommendations while using mysql? : Sql dba
Describe different types of general function used in sql?
How do you modify a trigger?
What is int identity in sql?
Is sql a programming?
What is embedded sql with example?
Why primary key is required?
What is rename in sql?
Why is %isopen always false for an implicit cursor?
How to assign sql query results to pl sql variables?
How many primary keys can a table have?