Re: Difference between = and IN

From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 02/07/05


Date: Mon, 07 Feb 2005 21:11:53 +0100

On Mon, 7 Feb 2005 07:19:02 -0800, Andy wrote:

>Hi Hugo
>
>I misunderstood what you meant in the previous post. I have worked out in
>the past that you have to use 'IS [NOT] NULL' rather than '<> Null' (or 'IN
>Null' or '= Null'). I thought you meant that NOT IN (1,2) would return
>strange results if Nulls were present in the records whereas (I believe) NOT
>IN (1,2) would return all rows that did not contain a 1, 2 or Null.

Hi Andy,

That's correct. It's good to see that you know that rows containing NULL
will not be returned be NOT IN (1, 2) - this is also a hefty surprise for
many people!

Best, Hugo

-- 
(Remove _NO_ and _SPAM_ to get my e-mail address)


Relevant Pages

  • Re: To bit or not to bit...
    ... >I have no idea what you are asking for since you seem to have misunderstood ... Perhaps examples of how NULLs can invalidate simple integer ... I thought you were saying ... based on the underlying data's physical clustering order as well as it ...
    (microsoft.public.sqlserver.programming)
  • sequential numbers added to null fields
    ... This is a strange one. ... Would anyone know of a strategy for querying a ... table, looking for nulls in a particular field, then filling those ...
    (comp.databases.ms-access)
  • Re: Lamore dei Tre Re - Opera Holland Park
    ... Strange. ... Maybe I misunderstood when they told me it was up there now. ... Thanks for that Mike - I just had a go on the web site and either you ... have had a sudden run on tickets or someone's switched it off ...
    (rec.music.opera)
  • Re: Tips for chain cleaning
    ... >misunderstood. ... But .3/16 is strange, and so, easily questioned. ... Jasper ... Prev by Date: ...
    (rec.bicycles.tech)
  • Re: Is there a .NET compiler ?
    ... Strange... ... I thought I was agreeing with you - I must have misunderstood. ... Sorry 'bout that - my motto is that if anyone on non-tech seems to be ...
    (borland.public.delphi.non-technical)