SQL aggregate functions 6/10 avg and round


#1

in section 6/10 of aggregate functions there is a query to select average and round it to 2 decimal places.
When I type SELECT ROUND(AVG(price), 2) FROM fake_apps; it return correct result
but when I type SELECT AVG(ROUND(price, 2)) from fake_apps; no result set is returned.

I want to know why these two aggregate function combination behave differently.


#2

Both work fine, but the answer will be different by a decimal value. Remember to add the “;”


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.