| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: UNIQUE and NULL in SQL
On 30 Dec 2001 19:04:56 -0800, brian-l-smith_at_uiowa.edu (Brian Smith)
wrote:
>
>In SQL, a table/column constraint is violated when it's condition is
>FALSE. In the case of a UNIQUE constraint, the condition is "[x] NOT
>IN (SELECT [column] FROM [table])". Now, "NULL NOT IN (SELECT [column]
>FROM [table])" will never be TRUE or FALSE; it is UNKNOWN. Therefore,
>the constraint should not be considered violated since it didn't
>evalutate to FALSE.
You can also look at a constraint as something which must always be true, instead of focusing on the violation. Do you like the integrity of you data to be UNKNOWN? :-)
-- Nis Jorgensen Amsterdam Please include only relevant quotes, and reply below the quoted text. ThanksReceived on Tue Jan 08 2002 - 09:50:26 CST
![]() |
![]() |