Ver Mensaje Individual
  #7 (permalink)  
Antiguo 20/02/2014, 13:32
piwy
 
Fecha de Ingreso: diciembre-2005
Mensajes: 65
Antigüedad: 18 años, 5 meses
Puntos: 4
Respuesta: Comparar 2 tablas identicas y obtener registros que no coinciden mysql

Prueba con algo del estilo:

Código MySQL:
Ver original
  1. SELECT 'Diferencias_new', t1.OPRID, t1.NAMEUSR, t1.ROLNAME
  2. FROM user_new t1
  3. WHERE t1.ROLNAME NOT IN (SELECT t2.ROLNAME FROM user_old t2 where t1.nameusr=t2.nameusr)
  4.  
  5.  
  6. SELECT 'Diferencias_old', t1.OPRID, t1.NAMEUSR, t1.ROLNAME
  7. FROM user_old t1
  8. WHERE t1.ROLNAME NOT IN (SELECT t2.ROLNAME FROM user_new t2 where t1.nameusr=t2.nameusr)

Opppsss, no había visto ya la respuesta anterior...