Hola.... Es correcta esta consulta????, osea he utilizado bien la estructura, utilizo Firebird
Código SQL
[-]
select ca.seccion||' '||ca.tipo_casilla as casilla,
(select count(rep_casilla)from casilleros
where rep_casilla='PROPIETARIO 1' and sec_cuid=ca.seccion
and tipo_casilla=ca.tipo_casilla group by sec_cuid,tipo_casilla) as Propietarios,
(select count(rep_casilla)from casilleros
where rep_casilla='SUPLENTE' and sec_cuid=ca.seccion
and tipo_casilla=ca.tipo_casilla group by sec_cuid,tipo_casilla) as Suplentes
from casillas ca inner join casilleros c on ca.cve_casilla=c.cve_casilla
where ca.fecha_eleccion='20.05.2007'
group by ca.seccion,ca.tipo_casilla