8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 10:00:38 +01:00
firebird-mirror/doc/sql.extensions
skywalker 47fc3374d0 documentation for new sql clauses case, coalesce and nullif
contributed by Arno Brinkman <firebird@abvisie.nl>
2002-08-08 23:33:23 +00:00
..
README.case documentation for new sql clauses case, coalesce and nullif 2002-08-08 23:33:23 +00:00
README.coalesce documentation for new sql clauses case, coalesce and nullif 2002-08-08 23:33:23 +00:00
README.nullif documentation for new sql clauses case, coalesce and nullif 2002-08-08 23:33:23 +00:00

Function:
    Speicify an alternative value for a column to return when it has a NULL 
    value.

Author:
    Arno Brinkman <firebird@abvisie.nl>

Format:

  <case abbreviation> ::=
      NULLIF <left paren> <value expression> <comma> <value expression> <right paren>


Syntax Rules:
    1) NULLIF (V1, V2) is equivalent to the following <case specification>:
         CASE WHEN V1 = V2 THEN NULL ELSE V1 END


Examples:
A)
  UPDATE PRODUCTS
    SET STOCK = NULLIF(STOCK,0)