id name kecheng chengji
1 张三 语文 70
2 张三 数学 90
3 李四 语文 85
4 李四 数学 87
5 李四 英语 88
6 王五 语文 79
7 王五 数学 90
8 王五 英语 82
用一条sql语句查询三门课程的成绩都大于80分的学生姓名
1 张三 语文 70
2 张三 数学 90
3 李四 语文 85
4 李四 数学 87
5 李四 英语 88
6 王五 语文 79
7 王五 数学 90
8 王五 英语 82
用一条sql语句查询三门课程的成绩都大于80分的学生姓名
解决方案 »
- visual studio 2010旗舰版的操作时,软件自动重启?
- 大家都来看看,看谁能做出来
- 不绑定数据给DataGrid,如何是DataGrid显示标题和十个行空行
- 这个QQ样的菜单怎么加图片进去?
- ====Excel数据在本机可以导入数据库,为什么放在服务器上就导不进去了??=请大师指点!!!
- 关于VS2008Web控件不能往页面中拖放的问题!
- vs2008设置sqldatasource控件连接数据库出错
- IIS浏览网页乱码,怎么解决?
- 页面中有的Button需要验证,而有的Button不需要验证,如何分开他们?
- 如何实现在asp.net中弹出一新窗口?(不用javascript)
- 在线等,RMB200有偿求助.net链接到库时的问题
- 这样的sql语句该怎么写,请教。
select [name] from (select [name], min(chengji) minfen from test1 group by [name])a where minfen > 80
select id name kecheng chengji from tablename t where not exists(select name from tablename t where chengji<80 and t.name=name)
修改下 select distinct name from tablename t where not exists(select name from tablename t where chengji<80 and t.name=name)
insert into w values(' 张三 ','语文', 70)
insert into w values('张三 ','数学', 90)
insert into w values('张三 ','英语', 9)
insert into w values( '李四 ','语文',85)
insert into w values( '李四',' 数学', 87)
insert into w values('李四',' 英语' ,88)
insert into w values('王五 ','语文' ,79)
insert into w values('王五', '数学', 90)
insert into w values('王五' ,'英语' ,82)insert into w values('主流 ','语文' ,79)
insert into w values('主流', '数学', 60)
insert into w values('主流' ,'英语' ,82)insert into w values('猪八 ','语文' ,98)
insert into w values('猪八', '数学', 89)
insert into w values('猪八' ,'英语' ,82)select name from w where name not in(select name from w where chengji<80) group by name
select distinct name from w a where not exists(select * from w where a.name=name and chengji<80)
这个应该是对的了
在加个
having count(chengji)=3
select distinct name
from list a
where not exists(select * from list where name=a.name and <=80)