I'm trying to get the lowest average rating for Movies in a database.
Currently I have:
select movie.movietitle as "Lowest Average Rating"
from movie, rating
where movie.movieid = rating.movieid
group by movie.movietitle
having avg(rating.rating) = min(avg(rating.rating));
But I'm getting the error "group function is nested too deeply." Can anyone provide me with a correct way of doing this and explain why this doesn't work?
Thanks