Ver Mensaje Individual
  #1  
Antiguo 29-09-2011
Avatar de microbiano
microbiano microbiano is offline
Miembro
 
Registrado: sep 2008
Ubicación: Mexico D.F
Posts: 349
Reputación: 16
microbiano Va por buen camino
buscar registros que estan en una tabla que no estan en otra

bien pues algo que crei realmente facil me esta sacando canas verdes jejeje, quiero saber que registros no estan en una tabla pero si estan en otra.

tabla 1

licitacion- gpo--gen-esp
00641321-017-10 --010--000-0104
00641321-017-10 --010--000-0105
00641321-017-10 --010--000-0106
00641321-017-10 --010--000-0107
00641321-018-10 --010--000-0105
00641321-018-10 --010--000-0106
00641321-018-10 --010--000-0106
00641321-018-10 --010--000-0107

tabla 2

licitacion- gpo--gen-esp -- rfc proveedor
00641321-017-10 --010--000-0104 ---XOBH-801025-UK1

BIEN LO QUE QUIERO ES QUE ME SAQUE LOS REGISTROS DE LA TABLA UNO QUE NO ESTAN EN LA TABLA DOS.

LO INTENTO CON LA SIGUIENTE CONSULTA PERO ME MUESTRA TODOS LOS REGISTROS.
Código SQL [-]
select * from REQUERIMIENTO as a
where not exists(select * from OFER_RECIB as b
where
a.gpo=b.gpo and
a.gen=b.gen and
a.esp=b.esp and
a.zona=b.id_zona and
b.rfc_proveedor='AME -900523-CM3') AND .a.licitacion='LA-019GYR047-T36-2011'
Responder Con Cita