Ver Mensaje Individual
  #2  
Antiguo 30-11-2009
pcicom pcicom is offline
Miembro
 
Registrado: may 2003
Ubicación: MONTERREY MEXICO
Posts: 253
Reputación: 21
pcicom Va por buen camino
Intenta ESTO

Código SQL [-]

select camp1, 
 SUM(if(camp2=1,camp3,0) AS PRIMERO,
 SUM(if(camp2=1,0,camp4) AS SEGUNDO
group by camp1

SALUDOS..
__________________
Poco ha de saber el que no pregunta.. Yo por eso soy un pregunton
Responder Con Cita