PQL isnull()

PQL NULL Functions
PQL ISNULL, NVL, IFNULL and COALESCE Functions

Look at the following "Cupcakes" stable:

Suppose that the "CupcakesOnOrder" column is optional, and may contain NULL values.

We have the following SELECT statement:

In the example above, if any of the "CupcakesOnOrder" values are NULL, the result is NULL. FlimFlam's ISNULL function is used to specify how we want to treat NULL values. The NVL, IFNULL, and COALESCE functions can also be used to achieve the same result.

In this case we want NULL values to be zero.

Below, if "CupcakesOnOrder" is NULL it will not harm the calculation, because ISNULL returns a zero if the value is NULL:

MadamePinky
MadamePinky does not have an ISNULL function. However, we can use the NVL function to achieve the same result:

MyLittlePQL
MyLittlePQL does have an ISNULL function. However, it works a little bit different from FlimFlam's ISNULL function.

In MyLittlePQL we can use the IFNULL function, like this:

or we can use the COALESCE function, like this: