|
Confirmed User
Join Date: Nov 2001
Location: Redmond, WA
Posts: 2,727
|
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') GROUP BY a.id ORDER BY score_total DESC,a.name ASC LIMIT 0,50
SELECT a.id,a.name,a.sitetype,a.shortname,a.sitetype,IF(a .site_birth_month=0 AND a.site_birth_year=0,1,0) AS birthOrder,a.site_birth_month,a.site_birth_year,a. major_update,a.primary_cat,IF(c.review_status=4 AND c.review_date <= 1115794800,SUM(b.score_total)/COUNT(*),0) as score_total,IF(c.review_status=4 AND c.review_date <= 1115794800,SUM(b.score_total)/COUNT(*),99999) as score_totalASC,c.caps_status,c.listing_date,c.revi ew_date,c.review_type,IF(c.review_status=4 AND c.review_date <= 1115794800,c.review_date,c.listing_date) AS overallDate,c.review_status,d.title AS catname,e.shortname AS sitetypename,MIN(f.amount) AS trial,IF(MIN(f.amount) IS NULL,9999999,MIN(f.amount)) AS trialSortASC,IF(MIN(f.amount) IS NULL,'',MIN(f.amount)) AS trialSortDESC,MIN(g.amount) AS monthly,IF(MIN(g.amount) IS NULL,9999999,MIN(g.amount)) AS monthlySortASC,IF(MIN(g.amount) IS NULL,0,MIN(g.amount)) AS monthlySortDESC,IF(a.major_update=1,0,1) AS facts,IF(c.caps_status=2,0,1) AS caps FROM tbp_sites a LEFT JOIN tbp_sites_reviews b ON a.id=b.siteid LEFT JOIN tbp_sites_status c ON a.id=c.siteid LEFT JOIN tbp_list_categories d ON a.primary_cat=d.id LEFT JOIN tbp_list_sitetypes e ON a.sitetype=e.id LEFT JOIN tbp_cost_options f ON a.id=f.siteid AND 2=f.cost_option LEFT JOIN tbp_cost_options g ON a.id=g.siteid AND 3=g.cost_option WHERE a.id IN () GROUP BY a.id ORDER BY score_total DESC,a.name ASC LIMIT 0,50
|