Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

duplicate NULL values

user9077483Feb 12 2010 — edited Feb 12 2010
Hi Experts,
It's a challenging question to all experts

Q1)
If we create an UNIQUE Key on a table Why it's accepting morethan one NULL value.

Q2)
If we use DISTINCT key word on a column that contains morethan one NULL value why it's displaying one NULL value.

Q3)
If we use UNION on a column that contains morethan one NULL value, why it returns one NULL value.

Q4)
If we write a query like this
SELECT * FROM emp WHERE comm IS NULL
Why it returns all the employes those contain no comm.

For 1st question some pleople are answering any NULL is not equal to other NULL value so that it accepting multiple NULL values.

For 2nd,3rd question some people are answering because DISTINCT and UNION eliminates duplicate values.

According to the first question answer how it is possible.

For 4th question answer some people are saying all the NULLs are equal so that it displaying all the employess which are having no commision.

Any One Plese help how NULL works in all four scenarios.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 12 2010
Added on Feb 12 2010
4 comments
3,927 views