It looks like you’re using Oracle so you can use the greatest function for this in place of max
select total/greatest(1,number_of_items)
from xxx;
It looks like you’re using Oracle so you can use the greatest function for this in place of max
select total/greatest(1,number_of_items)
from xxx;