Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/02/2006, 20:43
Avatar de claudiovega
claudiovega
 
Fecha de Ingreso: octubre-2003
Ubicación: Puerto Montt
Mensajes: 3.667
Antigüedad: 20 años, 6 meses
Puntos: 11
Prueba esta consulta sql:

Código:
select codigo, month(fecha) mes, year(fecha) as año, max(cantidad) total_mensual from historial_productos group by year(fecha), month(fecha) order by year(fecha), month(fecha)