How about, I have the following table:
What I want to do is a table like the following:
Where I show the number of students per semester in each career, in my table History, there are more than one student with the same id because that table refers to the subjects and how each student has several subjects and Each subject belongs to a semester:
I have the following query that gives me the highest semester of the student, that this is my semester that I want to consult:
SELECT idAlum, MAX(semes) as Semestre FROM Historial
GROUP BY idAlum;
And I have this other query that gives me the highest semester per race, but it is bad because if I have 2 students of the same race, only take into account the highest.
SELECT idPro, MAX(Semes) as Semestre FROM Historial
GROUP BY idPro;
I think I have to make a select within another select but I have not been able to resolve that part.
Beforehand, thank you.