Distinct with NULL [message #395266] |
Tue, 31 March 2009 23:59  |
ramesh55.sse
Messages: 262 Registered: December 2008 Location: Hyderabad
|
Senior Member |
|
|
SELECT comm FROM emp;
comm
---------
500
400
300
300
NULL
NULL
NULL
SELECT DISTINCT comm FROM emp;
comm
----------
500
400
300
NULL
According to nulls concept any null is not equal to other null value.But why it's returning only one null value.Please give me the reason it's very urgent.
[MERGED by LF]
[Updated on: Tue, 21 April 2009 14:15] by Moderator Report message to a moderator
|
|
|
|
|
|
|
distinct with null [message #399193 is a reply to message #395266] |
Tue, 21 April 2009 01:39   |
ramesh55.sse
Messages: 262 Registered: December 2008 Location: Hyderabad
|
Senior Member |
|
|
Employee table contains the following data
SQL>Select * from employee;
SALARY
----------
100
100
200
200
7 rows selected
In the employee table last three values are nul values
SQL> select distinct salary from employee;
SALARY
----------------
100
200
3 rows selected.
According to nuls concept any Null is not equal to NULL,but why it's returning only one NULL value.can u tellme the reason.
|
|
|
|
|