mySQL average?
Posted: Mon Sep 01, 2008 7:38 pm
everytime someone votes, it sets up the votes and vote_overall based upon the day... but everytime i run this query i get no results and theres records of vote_overall's in my database? WHY?
Code: Select all
SELECT name, username, theme_id, screen_url, SUM( `downloads` ) AS total_downloads, SUM( `votes` ) AS total_votes, AVG( 'vote_overall' ) AS vote_score, SUM( `demos` ) AS total_demos, SUM( `views` ) AS total_views
FROM theme_stats_by_day
WHERE 1
AND `day`
BETWEEN $start_date
AND $end_date
GROUP BY `theme_id`
ORDER BY vote_score DESC
LIMIT 0 , 12