|
Hola,
prueba esta consulta. Utilizo Firebird 1.5 y ha funcionado bien.
select e.idempresa,
(select count(*) from empleado ep where ep.idempresa=e.idempresa and edad<18),
(select count(*) from empleado ep where ep.idempresa=e.idempresa and edad>=18 and edad<65),
(select count(*) from empleado ep where ep.idempresa=e.idempresa and edad>65)
from empresa e
Saludos
__________________
Más se perdió en la guerra... y volvieron cantando
|