在支持分析函数的数据中,建议用分析函数代替Having查询
1.数据准备:
create table student(name char(50),subject char(50),score int,classid int);
insert into student values('张三','语文',79,1);
insert into student values('张三','数学',75,1);
insert into student values('李四','语文',76,1);
insert into student values('李四','数学',90,1);
insert into student values('王五','语文',90,2);
insert into student values('王五','数学',100,2);
insert into student values('王五','英语',81,2);
insert into student values('赵六','语文',87,3);