Ver Mensaje Individual
  #2 (permalink)  
Antiguo 21/03/2010, 14:42
jurena
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años, 10 meses
Puntos: 300
Respuesta: Consultar campos que no estan relacionados

SELECT c.nombre, c.ciudad, c.telefono FROM clientes c LEFT JOIN facturas f ON c.idcliente = f.idcliente WHERE f.idcliente IS NULL
o
SELECT c.nombre, c.ciudad, c.telefono FROM clientes c WHERE c.idcliente NOT IN (SELECT idcliente FROM facturas)

La primera de las dos opciones es más rápida.