How it works is, the IFNULL() function accepts two arguments. | IFNULL( null, 'Dog' ) | IFNULL( 'Horse', 'Dog' ) | IFNULL( 'Horse', null ) | Here’s an example of how IFNULL() works in those RDBMSs: SELECT
Example of IFNULL()Īs mentioned, RDBMSs such as MySQL, MariaDB, and SQLite include an IFNULL() function for replacing null values with another value. Other RDBMSs, such as SQL Server, Oracle, and PostgreSQL provide similar functionality via functions of a different name. In particular, MySQL, MariaDB, and SQLite each have an IFNULL() function that replaces any null values with another value. Some RDBMSs provide an IFNULL() function that can be used when dealing with potentially null values.