How to treat MAX() of an empty table as 0 instead of NULL
Just use Coalesce or NVL to handle NULLs.
The following code will return 0 if MAX(cid)
is NULL
SELECT COALESCE(MAX(cid), 0)
FROM itemconfiguration
SELECT NVL(MAX(cid), 0) FROM itemconfiguration;