SQLite equivalent to ISNULL(), NVL(), IFNULL() or COALESCE() SQLite equivalent to ISNULL(), NVL(), IFNULL() or COALESCE() sqlite sqlite

SQLite equivalent to ISNULL(), NVL(), IFNULL() or COALESCE()


Try this

ifnull(X,Y)  

e.g

select ifnull(InfoDetail,'') InfoDetail; -- this will replace null with ''select ifnull(NULL,'THIS IS NULL');-- More clearly....

The ifnull() function returns a copy of its first non-NULL argument, or NULL if both arguments are NULL. Ifnull() must have exactly 2 arguments. The ifnull() function is equivalent to coalesce() with two arguments.


If there is not ISNULL() method, you can use this expression instead:

CASE WHEN fieldname IS NULL THEN 0 ELSE fieldname END

This works the same as ISNULL(fieldname, 0).