In MariaDB, the NVL2()
function allows us to replace a value with another value, the new value being determined by whether or not the initial value is null.
It’s similar to the NVL()
function, except that NVL2()
accepts three arguments instead of two. This allows us to specify a different value to return in the event the first argument is not null.