Tema: Joins
Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/09/2008, 08:32
daniel00
 
Fecha de Ingreso: noviembre-2006
Ubicación: México
Mensajes: 866
Antigüedad: 17 años, 5 meses
Puntos: 8
Respuesta: Joins

Que tal así:
Código:
Select DA.Codigo As Defecto,
Count(DA.Codigo) As Cantidad
From catDefectoAparato DA
Left Outer Join catInventarioHogar IH On IH.xtDefectoAparato_Defecto_Critico = DA.Indice  
Inner Join catCapturaInspecciones CI On CI.xkInventarioHogar_Indice = IH.xqAsociacion
Inner Join catLoteAsignado LA On LA.Codigo_Lote = CI.Codigo_Lote
Inner Join catworkflowhistory WH On WH.Folio = LA.indice
Where LA.Codigo_Lote = 'L32RNZNGROB08381' And xtProceso_Proceso = '9' And WH.xtTarea_Tarea = '44'
Group By DA.Codigo, CI.Codigo_Lote
Order By DA.Codigo