Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/12/2010, 05:05
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 2 meses
Puntos: 574
Respuesta: sumar negativos

sum(if(importe <0, importe, 0)) as negativos, sum(if(importe <0, 0, importe)) as positivos

Algo así.

Quim