Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/07/2010, 10:43
jurena
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años
Puntos: 300
Respuesta: Maestros sin detalle

Código MySQL:
Ver original
  1. SELECT m.id_hruta FROM maestro m
  2.  LEFT JOIN detalle d ON m.id_hruta = d.id_hruta
  3.  WHERE d.id_hruta IS NULL

o también así:
Código MySQL:
Ver original
  1. SELECT m.id_hruta FROM maestro m
  2.  WHERE m.id_hruta NOT IN(SELECT id_hruta FROM detalle )