No id, remove the cartesian product also can appear the phenomenon of repeated, if jay a section 80 points on the drawing, also can be found out, how to write the SQL statement
CodePudding user response:
select name
The from student
Where fenshu> '80'
Group by name
Having a count (1)=2
CodePudding user response:
Select distinct s1. The name from student s1 where s1. The name not in (select s2. The name from student where s2 s2. Fenshu<80).CodePudding user response:
Think upstairs to, still have even if you despise me Marco?CodePudding user response:
Select distinct s1. The name from student s1 where s1. The name not in (s2) name from student where s2 s2. Scores & lt;=80);
CodePudding user response:
The select b.n ame from (select s.n ame name, min (fenshu) fenshu from studetn sGroup by s.n ame) b where b. enshu> 80
CodePudding user response:
- try this
Select the name
The from t
Group by name
Having the count (*)=sum (case when fenshu & gt; 80 then 1 else 0 end)
CodePudding user response:
Select the name,Min (fenshu)
From the table
The group by the name having min (fenshu) & gt; 80