Ver Mensaje Individual
  #6 (permalink)  
Antiguo 30/07/2008, 10:59
Avatar de flaviovich
flaviovich
 
Fecha de Ingreso: agosto-2005
Ubicación: Lima, Peru
Mensajes: 2.951
Antigüedad: 19 años, 6 meses
Puntos: 39
Respuesta: consulta sql count(*) ?????

Asi debería funcionar:
Código:
select
SUM(CASE WHEN PAB_TEC_Peridural = 1 then 1 else 0 end) [PAB_TEC_Peridural],
SUM(CASE WHEN PAB_TEC_TecGral = 1 then 1 else 0 end) [PAB_TEC_TecGral],
SUM(CASE WHEN PAB_TEC_TecRegion = 1 then 1 else 0 end) [PAB_TEC_TecRegion],
SUM(CASE WHEN PAB_TEC_TecLocal = 1 then 1 else 0 end) [PAB_TEC_TecLoca],
SUM(CASE WHEN PAB_TEC_Plexo = 1 then 1 else 0 end) [PAB_TEC_Plexo],
SUM(CASE WHEN PAB_TEC_Bloqueo = 1 then 1 else 0 end) [PAB_TEC_Bloqueo],
SUM(CASE WHEN PAB_TEC_Raquidea = 1 then 1 else 0 end) [PAB_TEC_Raquidea]
from PAB_Solicitud s
inner join PAB_Tecnicas t on s.PAB_SOL_Numero=t.PAB_SOL_Numero and s.PAB_SOL_Numero=t.PAB_SOL_Numero
inner join ATE_Prestacion p on s.PAB_SOL_Numero=p.ATE_PRE_NumerFormu
where ATE_PRE_FechaEntre >= '01/02/2008'
and ATE_PRE_FechaEntre < '01/05/2008'
and ATE_PRE_TipoFormu = '13'
and ATE_PRE_Vigencia = 'V'
and ATE_PRE_TipoMovim = 'I'
and ATE_PRE_CorrSocio = 0
and s.PAB_SOL_Estado = 'R'
and PAB_TEC_Peridural ='1'
__________________
No repitamos temas, usemos el Motor de busquedas
Plantea bien tu problema: Ayúdanos a ayudarte.