I have 2 querys and the result is a little different with the no of digits after decimal. For this field(data_month_1) it is defined as decimal(22,7) in the data type for both the tables.
Basicall we do a load of 90% of data_volume_month_01 from table 1 to table 2 and hence the values should match. Can anybody help whyc it shows different value after the decimal digits?
Now to show the comparison between both the tables what should be multiplied in query 1 so that i get the same result as that of in Table 2?
When you divide by 0.9 you increase the number of fractional digits to 8.
Simply cast back to 7 digits using
cast(sum(data_volume_month_01)*0.9 as dec(22,7))