sqlite IFNULL() in postgres
try coalesce: The COALESCE function returns the first of its arguments that is not null. Null is returned only if all arguments are null SELECT coalesce(max(code_id) + 1, 1) FROM configentries WHERE configtable_id = …
try coalesce: The COALESCE function returns the first of its arguments that is not null. Null is returned only if all arguments are null SELECT coalesce(max(code_id) + 1, 1) FROM configentries WHERE configtable_id = …
Use COALESCE: SELECT COALESCE(field_a, field_b) COALESCE is an ANSI standard function that returns the first non-null value from the list of columns specified, processing the columns from left to right. So in the example, if field_a is null, field_b value will be displayed. However, this function will return NULL if there is no non-null value … Read more