Ver Mensaje Individual
  #6 (permalink)  
Antiguo 24/02/2006, 16:38
Avatar de Mithrandir
Mithrandir
Colaborador
 
Fecha de Ingreso: abril-2003
Mensajes: 12.106
Antigüedad: 21 años
Puntos: 25
Prueba algo como esto:
Código:
SELECT * --todos los que existen en t1 y no en t2
FROM tabla1 t1
	LEFT OUTER JOIN tabla2 t2
ON t1.campo1 = t2.campo1
	AND t1.campo2 = t2.campo2
	AND t1.campo3 = t2.campo3
	AND t2.campo4 IS NULL
UNION ALL
SELECT * --todos los que existen en t2 y no en t1
FROM tabla1 t1
	RIGHT OUTER JOIN tabla2 t2
ON t1.campo1 = t2.campo1
	AND t1.campo2 = t2.campo2
	AND t1.campo3 = t2.campo3
	AND t1.campo4 IS NULL
__________________
"El hombre, en su orgullo, creó a Dios a su imagen y semejanza."
Friedrich Nietzsche