Subject Re: [firebird-support] Dividing one column by another
Author Louis Kleiman
We probably need to see the table structures, but NULL handling can be tricky.  You may want to do something along the lines of 
Coalesce(A.AMOUNT, 0)/Coalesce(B.VALUE, 1) to get something back when either of your source values is NULL.


On Fri, Dec 9, 2016 at 1:26 PM Russell Weetch russell@... [firebird-support] <firebird-support@yahoogroups.com> wrote:

I am trying to divide one column in table A by another in table B, but it just gives me null values. The query is

SELECT A.AMOUNT, B.VALUE, A.AMOUNT/B.VALUE
FROM TABLE1 A
JOIN TABLE2 B ON A.URN = B.URN

any ideas gratefully received.

Russell