how to do division in a query on a row by row basis?
Guess2Mar 27 2008 — edited Mar 27 2008I have two queries and I want to divide the results by each other on a row by row basis.
select location,count(*)
from mytable
where mycol1 is null
select location,count(*)
from mytable
where mycol1 is not null
I want to divide each location in each query, by each other. and if none come back on one query, I want to null value the output (so the denominator would null value to 1 and the numerator would nvl to 0)
how do I do this?