2005-02-02 00:55:56 +01:00
|
|
|
SQL Language Extension: NULLIF
|
|
|
|
|
2002-08-09 01:33:23 +02:00
|
|
|
Function:
|
2002-08-09 09:25:49 +02:00
|
|
|
Return a NULL value for a sub-expression if it has a specific value
|
|
|
|
otherwise return the value of the sub-expression
|
2002-08-09 01:33:23 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2005-02-02 00:55:56 +01:00
|
|
|
Notes:
|
|
|
|
See also README.data_type_results_of_aggregations.txt
|
2002-08-09 01:33:23 +02:00
|
|
|
|
|
|
|
Examples:
|
2005-02-02 00:55:56 +01:00
|
|
|
|
2002-08-09 01:33:23 +02:00
|
|
|
A)
|
|
|
|
UPDATE PRODUCTS
|
|
|
|
SET STOCK = NULLIF(STOCK,0)
|
|
|
|
|