Skip to content
Advertisement

How to round this in SQL

we just started our studying on SQL and I seem to have a slight problem with one exercise.

I would need to round the result of

SELECT AVG(points) AS Average FROM table;

I was trying to do it with subquery but I just did not hit the correct one even tough similar subqueries with only select seem to work well.

Any help?

Advertisement

Answer

Use ROUND

SELECT ROUND(AVG(POINTS), 2) AS Average
FROM table;
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement