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

python - SWIG function not printing output -

css - I want to align grid in center -

Contact Form PHP Email Script -