1
I have a question about how to group the data as follows.
I have a table called ALUNO_LEGADO, as below:
I need to put together a query to get all the students who failed every subject enrolled in a given year. Ex.: Select students who failed all courses in 2015.
- Obs.: the concepts are: A = Approved, R = Failed
- Note. 2: There is no standard number of subjects for each student, as he has the free choice to enroll in 1 or more subjects.
The idea is to select the guy who failed in all the disciplines in which he 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 have R concept in 2015, and not only students who failed in all courses in 2015. Understands?
Thank you Hwapx I used the first solution and it worked !
– Raphael Teodoro