Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/05/2009, 12:35
jurena
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años, 1 mes
Puntos: 300
Respuesta: Recuperar lista con campo que sea un SELECT de otra tabla

No la he probado

Código sql:
Ver original
  1. SELECT alumnos.nif, alumnos.nombre, t1.total totalpendientes
  2.   FROM alumnos INNER JOIN
  3.     (SELECT alumno, COUNT(*) total FROM examenes
  4.       WHERE evaluado = FALSE GROUP BY alumno HAVING total >=1 )t1
  5.          ON alumnos.nif = t1.alumno ORDER BY alumnos.nombre

Última edición por jurena; 08/05/2009 a las 12:40