Closed. This question is not reproducible or was caused by typos . It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 days ago.
Improve this question
I have a table called student.
student_name | subject |
---|---|
A | math |
A | english |
B | math |
C | english |
Now I want a sql query which will only output student name who are not studying math. In the case the output should be student c.
SELECT student_name, subject
FROM students
WHERE student_name NOT IN (
SELECT student_name
FROM students
WHERE subject = 'Math'
);
In this solution it will pick student a from row 1.
2条答案
按热度按时间cs7cruho1#
This code worked for me
ffx8fchx2#
or