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 records | matt_lists | 25 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Keith Ivey | 25 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | SGreen | 25 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Paul DuBois | 25 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Harald Fuchs | 28 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Jigal van Hemert | 28 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 records | Harald Fuchs | 28 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Jigal van Hemert | 28 Oct |
| • Re: bug or feature, <> 'blah' does NOT work with null records | Martijn Tonies | 30 Oct |
| • RE: bug or feature, <> 'blah' does NOT work with null records | Jay Blanchard | 25 Oct |