Check out with a SQL statement for each course is greater than 80 names of the students

Name kecheng fenshu
Joe Smith 81 Chinese
Zhang mathematics 75
John Doe 76 languages
Doe 90 math
king five languages of the 81
king MATHEMATICS 100
Wangwu Ying language 90

Solution one: find <= 80 student name, student's name is not among these is the> 80 Student Name

select distinct name from table where name not in(
select distinct name from table where fenshu<=80)

Solution two: find the lowest score> 80 points Student Name

select name from (select name,min(fenshu) from table group by name having min(fenshu) > 80) table

Guess you like

Origin www.cnblogs.com/ButterflyEffect/p/12083810.html