views:

33

answers:

1

I want to compare two results one is stored in the first query, and the other is exactly the same as the first, but i want only to recieve data < today

    "SELECT  s.GSP_nom as nom, timestamp, COUNT(s.GSP_nom) as nb_votes, AVG(v.vote+v.prix+v.serviceClient+v.interface+v.interface+v.services)/6 as moy
   FROM votes_serveur AS v
   INNER JOIN serveur AS s ON v.idServ = s.idServ
    WHERE s.valide = 1
   AND v.date < CURDATE()
   GROUP BY s.GSP_nom 
            HAVING nb_votes > 9 
            ORDER BY moy DESC LIMIT 0,15";

is that correct ? thank you

+1  A: 

GROUP BY, not ROUP BY
v.date < CURDATE() looks o.k.

Col. Shrapnel
yeah, error in formatting, thx ;)
Tristan
@Tristan what is the question anyway? what is this first query and where is another?
Col. Shrapnel
what ? i'm not sure i understand well, my question was about curdate and you answered it. Thank you
Tristan