List:General Discussion« Previous MessageNext Message »
From:Jari Aalto Date:September 25 2009 4:06pm
Subject: Re: 4.1 in production
View as plain text  
Victoria Reznichenko <victoria.reznichenko@stripped> writes:

> "Holly Chamberlain" <hollyc@stripped> wrote:
>
>>
>> Does anyone have a good site that contains the current SQL standard? Or
>> does anyone know is ISNULL() and IFNULL(), and similar null testing
>> functions, standard SQL or extensions to SQL?
>
> No, there are no such functions in the SQL-99. In the standard you can
> find IS [NOT] NULL to see if value is NULL or not.

There is[1]. The SQL standard defines following special CASE-END
shortcut functions:

    NULLIF()    To convert ITEM to NULL
    COALESCE()  To convert NULL to ITEM (this is what you usually want)

Jari Aalto

-----------------------------------------------------------------------

[1] The SQL:1992 standard, heading "6.9 <case expression>".
http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt

         <case abbreviation> ::=
                NULLIF <left paren> <value expression> <comma>
                      <value expression> <right paren>
              | COALESCE <left paren> <value expression>
                      { <comma> <value expression> }... <right paren>

As standards are backward compatible, this applies to SQL:2008 as well.

Thread
4.1 in productionsean peters24 Oct
  • Re: 4.1 in productionJari Aalto25 Sep