Mysql
 sql >> Database >  >> RDS >> Mysql

Raggruppamento SQL per:utilizzando la logica della clausola where per filtrare i risultati in base a funzioni aggregate

basta aggiungere un having clausola:

select url, avg(contentping+tcpping), count(*) from websites ws, ping pi 
where ws.idwebsite = pi.idwebsite and errortype is null
group by url 
having avg(contenetping+tcpping) < 500
order by avg(contentping+tcpping) asc;