SELECT max(x) is returning null; how can I make it return 0? February 2, 2023 by Tarik or: SELECT coalesce(MAX(X), 0) AS MaxX FROM tbl WHERE XID = 1