List:General Discussion« Previous MessageNext Message »
From:Keith Ivey Date:October 25 2004 7:11pm
Subject:Re: bug or feature, <> 'blah' does NOT work with null records
View as plain text  
matt_lists wrote:

> I cant tell if this is a bug or a feature.
>
> Select from table where col <> 'blah'
>
> I use this all the time with other databases, works great, gives me 
> everything that's not "blah"


In SQL (not just MySQL), any comparisons involving NULL return NULL,
so if that was working in some other database, it's a bug in that database.

See these pages about MS SQL Server and PostgreSQL (which does have a 
workaround), for
example:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_02_8pwy.asp
http://www.sql.org/sql-database/postgresql/manual/functions-comparison.html

-- 
Keith Ivey <keith@stripped>
Washington, DC

Thread
bug or feature, <> 'blah' does NOT work with null recordsmatt_lists25 Oct
  • Re: bug or feature, <> 'blah' does NOT work with null recordsKeith Ivey25 Oct
    • Re: bug or feature, <> 'blah' does NOT work with null recordsSGreen25 Oct
  • Re: bug or feature, <> 'blah' does NOT work with null recordsPaul DuBois25 Oct
  • Re: bug or feature, <> 'blah' does NOT work with null recordsHarald Fuchs28 Oct
  • Re: bug or feature, <> 'blah' does NOT work with null recordsJigal van Hemert28 Oct
    • Re: bug or feature, <> 'blah' does NOT work with null records(Pete Harlan)29 Oct
  • Re: bug or feature, <> 'blah' does NOT work with null recordsHarald Fuchs28 Oct
  • Re: bug or feature, <> 'blah' does NOT work with null recordsJigal van Hemert28 Oct
  • Re: bug or feature, <> 'blah' does NOT work with null recordsMartijn Tonies30 Oct
RE: bug or feature, <> 'blah' does NOT work with null recordsJay Blanchard25 Oct