1.查詢出每門課都大于 80 分的學生姓名
晉江ssl適用于網(wǎng)站、小程序/APP、API接口等需要進行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)建站的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18980820575(備注:SSL證書合作)期待與您的合作!
create table test2( id int not null auto_increment, name varchar(10), kecheng varchar(10), fenshu int, primary key(id) ) insert into test2(name,kecheng,fenshu) values('張三','語文',81 ); insert into test2(name,kecheng,fenshu) values('張三','數(shù)學',75 ); insert into test2(name,kecheng,fenshu) values('李四','語文',76 ); insert into test2(name,kecheng,fenshu) values('李四','數(shù)學',90 ); insert into test2(name,kecheng,fenshu) values('王五','語文',81 ); insert into test2(name,kecheng,fenshu) values('王五','數(shù)學',100); insert into test2(name,kecheng,fenshu) values('王五','英語',90 ); -- (1) select name from test2 group by name having min(fenshu) > 80; 王五 -- (2) select distinct name from test2 where name not in (select distinct name from test2 where fenshu<=80) 王五