I have a table with 3 columns ( smallint) in SQL Server 2005.
Table Ratings
ratin1 smallint,
ratin2 smallint
ratin3 smallint
These columns can range from 0to 5.
How can I choose the average value of these fields, but only compare the fields where the value is greater than 0.
So, if the value of the column 1, 3, 5- the mean value must be 3. if the values of 0, 3, 5- the mean value must be 4.
source
share