Ver Mensaje Individual
  #10  
Antiguo 17-08-2007
hach hach is offline
Miembro
 
Registrado: mar 2007
Ubicación: Bariloche, Argentina
Posts: 44
Reputación: 0
hach Va por buen camino
Thumbs up prueba con esta consulta, deberia funcionar

Código SQL [-]
select a_codigo, sum(a_cantidad) from a
where a_borrado=0 and a_codigo not in
(select a_codigo from b where b_borrado=0)
group by a_codigo
union
select a_codigo, sum (b_cantidad_real) from b
where b_borrado=0
group by a_codigo

Espero te sirva!!!

Saludos
Responder Con Cita