List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:October 30 2004 2:29pm
Subject:Re: bug or feature, <> 'blah' does NOT work with null records
View as plain text  
> > Fortunately there is function COALESCE() that will return the first
argument
> > that is not NULL. In case of NULL values you can use a default value for
an
> > expression: COALESCE( `col`*2, 14) will produce 14 if `col` is NULL.
>
> FWIW, IFNULL() does the same thing, with a clearer (to me) name, e.g.,
> IFNULL(sum(qty), 0).

Do note, that COALESCE is the standard name for this :-)

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com

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