Dynadot — .com Transfer

Issues with a Mysql query

SpaceshipSpaceship
Watch

Jawn

Straight from SwedenEstablished Member
Impact
2
Hello

Im not sure how to solve this but i want my query to only count totalaverage if number of webhosting ratings are more than "3"

But im not sure how to do this and would really appreciate if someone could help me.

Code:
SELECT 
SQL_CALC_FOUND_ROWS 
COUNT(c.reliability), 
a.packetname, 
a.drivespace, 
a.traffic, 
a.yearlyprice, 
b.title, 
b.logoimage, 
b.urlsafe, 
(AVG(c.reliability) + AVG(c.support) + AVG(c.cost)) / 3 AS totalaverage 
FROM 
webhosting_companies_packets AS a 
LEFT JOIN 
webhosting_companies AS b ON a.wid = b.id 
LEFT JOIN 
webhosting_companies_rating AS c ON c.wid = a.wid 
WHERE 1 
GROUP BY 
a.id 
ORDER BY 
totalaverage DESC

I guess you cant have another condition on left join? like

Code:
LEFT JOIN 
webhosting_companies_rating AS c ON c.wid = a.wid AND COUNT(c.reliability) > 3


Best Regards

John
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Catchy
CatchDoms
DomainEasy — Live Options
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back