I'm currently working on an application (in Java) which writes to an Oracle (8i) database. I'm then creating views from this, from which I can view reports.
I'm having a problem in one calculation in the view, cause sometimes I get a divide by zero error. EG: a = x / y and y can sometimes be zero.
I dont want to change the way the code works cause zero is a ligitimate answer, so what I was wondering was is there a way to create a SQL view which will get over this? Maybe something like:-
if y = zero, then output zero for a,
else a = x / y