I have a question about how to group the data as follows.
I have a table named ALUNO_LEGADO , as below:
I need to assemble a query to catch all the students who failed in all the subjects enrolled in a given year. Eg: Select students who failed in all subjects taken in 2015.
- Note: the concepts are: A = Approved, R = Disapproved
- Obs. 2: There are not a number of standard courses for each student, as they have the free choice of enrolling in 1 or more courses.
The idea is to select the face that failed in all subjects in which it was related in the year 2015.
create table aluno_legado
SELECT
RA
FROM ALUNO_LEGADO
WHERE conceito = 'R'
AND ano = 2015
GROUP BY RA
However this query simply brings RA's that has concept R in 2015, and not only the students who failed in all subjects taken in 2015. Do you understand?