I try to select max value from table
SELECT MAX(cid) FROM itemconfiguration;
However when table itemconfiguration is empty th
itemconfiguration
Can replace a number when max return null using ISNULL ,
ISNULL(MAX(cid),0) FROM itemconfiguration;