I want to basically take a number (total_score) and divide it by the number of (release_date)s that are <= today. I definitely want to do the math within the SELECT statement. I tried this but it doesn't seem to work:
SELECT
total_score / COUNT(release_date <= CURDATE()) as final_score
from movies
WHERE id = 12
So say the total score is 400 and the number of release_dates that are <= today is 2. final_score should come out as 200.
Can I calculate within the SELECT statement like this? COUNT(release_date <= CURDATE())