MINVALUE
Examples
SELECT MINVALUE(PRICE_1, PRICE_2) AS PRICE
FROM PRICELIST
Functions for Sequences (Generators)
MINVALUE
ExamplesSELECT MINVALUE(PRICE_1, PRICE_2) AS PRICE
FROM PRICELIST
NULLIF()
Conditional NULL
function
Depends on input
NULLIF (<exp1>, <exp2>)
Parameter | Description |
---|---|
exp1 |
An expression |
exp2 |
Another expression of a data type compatible with exp1 |
NULLIF
returns the value of the first argument, unless it is equal to the second.In that case, NULL
is returned.
NULLIF
Exampleselect avg( nullif(Weight, -1) ) from FatPeople
This will return the average weight of the persons listed in FatPeople, excluding those having a weight of -1, since AVG
skips NULL
data.Presumably, -1 indicates “weight unknown” in this table.A plain AVG(Weight)
would include the -1 weights, thus skewing the result.