Ver Mensaje Individual
  #10  
Antiguo 07-04-2008
Avatar de MaMu
MaMu MaMu is offline
Miembro
 
Registrado: abr 2006
Ubicación: Argentina
Posts: 863
Reputación: 21
MaMu Va por buen camino
Cita:
Empezado por valiant_crps Ver Mensaje
otra cosa:

la version anterior de mysql 4.1.xx no permite hacer consultas anidadas asi que ojo con eso tambien o mysql lanzara un error
No entiendo, a que llamas consultas anidadas, a subconsultas?
Porque si es asi, yo utilizo la versión 4.0.xx de mySQL y casi todas mis aplicaciones usan subconsultas.

Código SQL [-]
Select a.categoria,
  (Select sum(debe) from caja t1
   where t1.categoria = a.categoria and year(t1.fecha) = 2008) as egreso2008,
  (Select sum(haber) from caja t2
   where t2.categoria = a.categoria and year(t2.fecha) = 2008) as ingreso2008,
  (Select sum(debe) from caja u1
   where u1.categoria = a.categoria and year(u1.fecha) = 2007) as egreso2007,
  (Select sum(haber) from caja u2
   where u2.categoria = a.categoria and year(u2.fecha) = 2007) as ingreso2007
from parapersonales a

Ejecutado con mySQL 4.0.22

Saludos
__________________
Código Delphi [-]
 
try 
ProgramarMicro(80C52,'Intel',MnHex,True);
except
On Exception do
MicroChip.IsPresent(True);
end;
Responder Con Cita