Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/08/2009, 20:16
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años, 8 meses
Puntos: 2135
Respuesta: no tengo ni idea de como hacer esto, quien me ayuda?

Prueba tu query así:
Código SQL:
Ver original
  1. SELECT producto,SUM(cantidad)AS cantidad_total FROM tablas WHERE fecha>='$fecha' GROUP BY producto ORDER BY cantidad_total DESC LIMIT 7

Saludos.