Here is my SQL statement
SELECT ROUND(AVG(column_name), 100) FROM [database].[dbo].[table]
The answer I retrieve is 3 with a possible range of numbers between 1 - 5 in 908 rows.
3
1 - 5
I need it to say 3.0 or 3.09. Is this possible?
3.0
3.09
The average will have the same data type as the values, so cast the values:
SELECT ROUND(AVG(CAST(column_name AS FLOAT)), 2) FROM [database].[dbo].[table]
1.4m articles
1.4m replys
5 comments
57.0k users