Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/09/2012, 12:48
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 9 meses
Puntos: 774
Respuesta: Query Complejo

select t1.key1, t1.key2, t1.parte, t1.cantidad,
sum(t2.embarcado)
from t1, t2 where t2.key2 = t1.key1 and t2.key3 = t1.key2
group by t1.key1, t1.key2, t1.parte, t1.cantidad,t2.embarcado




algo asi?? El error en tu query no era que no hubiera datos en la tabla 2 sino que no estas agrupando el campo embarcado......
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me

Última edición por Libras; 11/09/2012 a las 12:54