Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Snehasis.

Asked: January 08, 2018 - 8:48 am UTC

Last updated: January 08, 2018 - 1:30 pm UTC

Version: 11g

Viewed 1000+ times

You Asked

I have a table Test_Null with columns A, B and Data Present Inside Table is:

SQL>select * from test_null;

A B
---------- ------
1 NULL
2 NULL
3 NULL
4 NULL

Query
SELECT DISTINCT(B) FROM Test_Null
Result:
B
--
(NULL)

If One NULL value is not same as other Null,Then why DISTINCT clause considers only one NULL value ?.

and Connor said...

That is the "documented, by definition" behavior of distinct as per the language specification.

group by works the same way.


Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Clarification Regarding Distinct Keyword

snehasis, January 12, 2018 - 3:07 am UTC

Thanks, Corner...For Your Response

More to Explore

SQL

The Oracle documentation contains a complete SQL reference.