Here is the query i am running
Select (100/18)*18
The answer i get is 90. I have tried declaring each of the numbers as decimals also, and i get the value 100.0008, but when i calculate with variables as floats the answer is correct at ‘100’ so does anyone have any idea why SQL calculates like this?
Because it will first evelute the paranthesis
So
will (100/18) = 5.555555 but it assume both number as int so it will cast the result as int so it will return 5
so now
5*18 = 90If you want the correct result do this instead
Select (100*18)/18