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
how to delete duplicate rows from a join tables(I have three tables on that join) how do you know which join is need to be used? The select statement I have is: SELECT gc_skill_type.skill_type, gc_area_tec.area, gc_technology.technology, gc_technology.id_technology, gc_area_tec.id_area_tec FROM gc_skill_type, gc_area_tec, gc_technology WHERE gc_area_tec.id_skill_type (+) = gc_skill_type.id_skill_type AND gc_technology.id_area_tec (+) = gc_area_tec.id_area_tec order by gc_skill_type.skill_type asc, gc_area_tec.area asc, gc_technology.technology asc
What does count (*) do in sql?
What is the difference between left and left outer join?
what is dbms? : Sql dba
Is sqlexception checked or unchecked?
What is oracle pl sql developer?
how to convert dates to character strings? : Sql dba
how to convert character strings to numeric values? : Sql dba
List the different type of joins?
How to display the records between two range in Oracle SQL Plus?
Which is faster count (*) or count 1?
Is sql injection illegal?
Why self join is used in sql?
what is the maximum length of a table name, database name, and fieldname in mysql? : Sql dba
What is oracle and pl sql?