Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/05/2012, 12:13
patito23
 
Fecha de Ingreso: enero-2011
Mensajes: 6
Antigüedad: 13 años, 4 meses
Puntos: 0
Respuesta: Como generar registros que no estand entro de una tercera tabla

solamente esto
select cargas.vehic,cargas.litros,cargas.cliente,
g.vehic,g.cliente,veh.vehic,veh.codcliente
from CARGAS
inner join VEH
on CARGAS.VEHIC=VEH.VEHIC
inner join grupo as g
on G.VEHIC=CARGAS.VEHIC AND VEH.VEHIC=G.VEHIC
where cargas.fecha between '2012-04-01 00:01:00' and '2012-04-30 23:59:59'
and cargas.tipo=1 and g.cliente <> veh.codcliente


pero me duplica cargas y si le pongo el distinct aun asi me da duplicados