Ver Mensaje Individual
  #5 (permalink)  
Antiguo 30/03/2010, 19:07
nightduke
 
Fecha de Ingreso: mayo-2008
Mensajes: 181
Antigüedad: 16 años
Puntos: 0
Respuesta: ordenar meses

lo consegui...

(SELECT id, sum(importe), concepto FROM `todos` WHERE fecha like '2005' and id between 1 and 100 group by id)order by id +0;


Cita:
Iniciado por nightduke Ver Mensaje
Tengo esta otra consulta pero que no consigo que me funcione...

(SELECT id,sum(importe),concepto FROM `todos` WHERE fecha like '2005' group by id order by id +0)
union all
(SELECT id,sum(importe),concepto FROM `todos` where id between 1 and 100 group by id)order by id +0;

¿Se puede hacer esta consulta?

where fecha es un año 2005,2006

¿where fecha like '2005' or where id between 1 and 100?
¿Se puede hacer algo asi en una sola consulta?

Gracias