Hello,
After reading the theory I still don't understand the following:
"The evaluated result of expression determines the return type."

The wording "The evaluated result of expression" I interpret as "calculate the average and see what the value you've got - depending ON THE RESULTING VALUE make a decision which return type to use (for example, if the resulting AVG value =5, than the return type = INT; if the value = 5.56, than the return type = decimal and ...). The key point here is that it is the RESULTING VALUE that determines the return type, NOT the type of the expression itself!
The practice is the opposite:
AVG(Col2) returns the 2 instead of ~2.7, whilst AVG(Col2) for another table with the Col2 = decimal returns the correct (decimal) result:
In other words it looks like the wording should read "the type of expression determines the return type" - NOT the "The evaluated result of expression determines the return type.*".
What am I missing here?
Thank you in advance,
Michael