I want to demonstrate the problem with the help of an example.
Accurate division: 7299 / 48 = 152.0625 However, in Teradata all precision is lost when querying for select 7299/48 = 152
We have to apply a cast for precision, like: select cast(7299/48 as decimal(8,5))
Assuming that my data column has a length of 8. Here I cannot provide value greater than 8 in the first argument. In the second argument (number of digits after decimal point), at max I can provide 5 because the result yields 3 digits in the numeric part and as a remainder we get 5 (8-3).
I'm asking this because I can go into troubles if I apply the same cast to: select 72990/48 = 1520.625 because here the numeric part has 4 digits and I can only supply 4 in the second argument.
Is there a way that I can specify only the first argument 8 (equaling to the length of the column) and get the result with complete precision?