Ver Mensaje Individual
  #2  
Antiguo 29-05-2006
Avatar de __hector
[__hector] __hector is offline
Miembro Premium
 
Registrado: may 2003
Ubicación: Santo Domingo, Rep. Dom.
Posts: 1.075
Reputación: 25
__hector Va por buen camino
Que tal algo asi:

Código SQL [-]
INSERT INTO Estadistica (curso, matriculados, notaExcelente, notaRegular, notaDesaprobatoria)

SELECT A.curso,
     count(A.*),
     (SELECT COUNT(*) FROM Nota WHERE Curso = A.curso AND Nota >8),
     (SELECT COUNT(*) FROM Nota WHERE Curso = A.curso AND Nota BETWEEN 6 AND 8),
     (SELECT COUNT(*) FROM Nota WHERE Curso = A.curso AND Nota < 6)

FROM Nota A
GROUP BY curso
__________________
Héctor Geraldino
Software Engineer
Responder Con Cita