we have 2 table, table A and table B,
we are fetch 6 columns in select statement, these are the columns
now we have to put mathematics condition in query:
A.current_value – B.current_tax is within +/- 2, and
If A.original_value is blank use A.current_tax_lot to perform the formula:
2a. A.current_tax_lot (from above) – B.cost_tax is within +/- 10, or
2b. A.current_tax_lot(from above) – current_tax_cost is within +/-10)
If have not understood a block/calculation, substitute terms / expressions appropriately.
Select ...
Where
ABS(NVL(A.current_value, A.current_tax_lot) – B.current_tax) <=2
AND
(
ABS(A.current_tax_lot – B.cost_tax) <= 10
OR
ABS(A.current_tax_lot – B.current_tax_cost) <= 10
);