syntax - SQL. Finding the average between certain dates -


i'm trying find average score received films between time

select sum (score * ?) / sum(?) aggsco   movie, casting        inner join casting  movie.id = casting.movieid        , yr between 1930 , 1939; 

instead of question marks, think need number of occurrences. following need repeat code find average between 40 , 49 , 50 59. there loop can use or need rewrite code? advice!

ps: i'm using squirrel, not mysql syntax may differ

select sum(score) / count(*) averagescote ... 

or better

select avg(score) ... 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -