Thursday 15 May 2014

sql - why is null not equal to null false -


I was reading this article:

And the consensus is that when the similarity between the two (

  from where ((a = b) or (a is null and b is null))  

when A and B are NALs, (A = B) still FALSE, because NULL is not equal to NULL. This is the reason that additional check is required.

What will happen when testing inequalities? After the above discussion, it seems to me that inequality To test, I will need to do something like this:

  WHERE (() (or not one is zero and b though, I have seen that this Not at all (not least at Ephesians 11.5), and I can do just that: (Score: 5, Funny)  
  where (a  )  

If A and B are Null, then it goes wrong if zero is not equal to null, then will not it be correct?

Edit < / Strong>
These are all good answers, Ekin I think my question was a bit unclear

  (where A & lt; & Gt; B)  

Given that A or B can be null, code>

Or let me clear it There is a need to check this type of:

  WHERE ((A ; gt; b) or (A is not and is not zero) or (A is null and b Is not))  

To view this question, refer to this reference.

Relational expressions related to the tap actually come in the tap again

< Em> edit

here, & lt; & Gt; stands for random binary operator, NULL is a SQL placeholder, and value is a value ( NULL is not one value):

  • NULL & lt; & Gt; Value -> NULL
  • NULL & lt; & Gt; NULL -> NULL

Argument: NULL means "no value" or "unknown value" , And thus there is no point in any comparison with any real value .

is X = 42 is correct, false, or unknown, which you do not know what value (if any ) X holds? SQL says that this is unknown. Is X = y correct, inaccurate, or unknown, provided both are unknown? SQL says the result is unknown . And it calls for any binary relational operation, which is only logical (even before the model is in place before the blueprint).

SQL also has two unary postfix provides operators, IS NULL and IS NOT NULL , these are their TRUE or FALSE according to their operation.

  • NULL IS NULL -> TRUE
  • is not fired -> < Code> FALSE

No comments:

Post a Comment