Ver Mensaje Individual
  #6  
Antiguo 16-07-2008
celades1 celades1 is offline
Miembro
 
Registrado: ago 2005
Posts: 116
Reputación: 21
celades1 Va por buen camino
Hola

Código SQL [-]
Select distinct BO.DATEFROM, BO.DATETO, CA2.CATEGORYNO,
(Select Count(*) from OBJECTS OB
 left join CATEGORIES CA1
   on OB.CATEGORYNO      = CA1.CATEGORYNO
   and CA1.SUBCATEGORYNO = 0
 where OB.BUILDINGNO = 1
 and CA1.CATEGORYNO  = BO.CATEGORYNO) as SumCount
from BOOKINGS_OBJECTS_TEMP BO
left join CATEGORIES CA2
  on BO.CATEGORYNO      = CA2.CATEGORYNO
  and CA2.SUBCATEGORYNO = 0
where CA2.DIVISIONTYPE    = 0
and CA2.OBJECTRESERVATION = 0


Pero no entiendo que hace el left join de la subconsulta yo haria join sin left

Tampoco entiendo porque no te funciona tal como lo tienes porque lo veo bien


Saludos
Responder Con Cita