sql - Addition of two columns in sub query not giving correct result set -
select a, b dcl a='123' , b> ( select sum(a) + (select sum(a) d a= 1506453) aslp a.a= '0527416666')
the output getting
a=123 b= 23
as per condition have written in sub query should not above record.
let me make wild guess here: 1 of columns
ecpclaim_total_claim_charge ecpservicelinepayment_payment_amount ecpservicelinepaymentcobadjustment_amount
is defined data type float or real means you're comparing inexact floating point numbers. explain why 60.06 > 51.05 + 9.01
can evaluate false of course shouldn't if numbers precise.
the remedy either change data type exact numeric type or coerce values precise type comparison.
sample sql fiddle demonstrating problem , possible fix.
Comments
Post a Comment