Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/10/2009, 10:38
Avatar de bacdavi
bacdavi
 
Fecha de Ingreso: junio-2006
Ubicación: http://localhost/
Mensajes: 351
Antigüedad: 17 años, 11 meses
Puntos: 7
Pregunta Problema con SUM() y GROUP()

Hola amigos, tengo un problema con mi consulta a la bd, dicha consulta la realizo con codigo PHP y me despliega el error MySQL:

Código Error MySQL:
Ver original
  1. Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause

Código SQL:
Ver original
  1. SELECT SUBSTRING(FECHA,6,2) MES,SUM(facturacion) FROM presupuesto WHERE
  2. SUBSTRING(Fecha,1,4) = '2009' AND producto IN ('16','17')
  3. GROUP BY SUBSTRING(fecha,6,2)
  4. ORDER BY SUBSTRING(fecha,6,2)

Alguno de ustedes tiene idea de que estoy haciendo mal??