Answer the question
In order to leave comments, you need to log in
How to write a query to display classes in which only excellent students?
Display a list of classes with only excellent students
, let's say a table with 2 columns:
class and annual grade
, you need to display those classes in which there are only fives
Answer the question
In order to leave comments, you need to log in
As an option:
select distinct class
from t
where class not in (select distinct class from t where score <> 5)
For example like this:
select class
from students
group by class
having count(*)*5 = sum(rang);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question