Divide decimal by decimal and get zero
问题 Why when I do: select CAST(1 AS DECIMAL(38, 28))/CAST(1625625 AS DECIMAL(38, 28)) Do I get 0, but when I do select CAST(1 AS DECIMAL(20, 10))/CAST(1625625 AS DECIMAL(20, 10)) I get a value? I would have expected the higher precision division to return a higher precision result, why is this not the case? 回答1: This happens because for math operations the resulting precision and scale is calculated with the rules found in http://msdn.microsoft.com/en-us/library/ms190476.aspx#division operation