首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

提问~该怎么处理

2012-02-28 
提问~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(2)如求用一条SQL语句 查询出每门课都大于80分的学生姓名nameke

提问~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(2)如求用一条SQL语句 查询出每门课都大于80分的学生姓名 
name kecheng fenshu  
张三 语文 81 
张三 数学 75 
李四 语文 76 
李四 数学 90 
王五 语文 81 
王五 数学 100 
王五 英语 90 
用这样的可以么。
1) select distinct name from table where not exists (select distinct name from table where fenshu <=80) 

2)select distinct name from table where not exists (select distinct name from table name=table.name where fenshu <=80) 
以上那个对?或是2个都不对?
最好比较一下错在那里。



[解决办法]
1) select distinct name from table where not exists (select distinct name from table where fenshu <=80)

2)select distinct name from table where not exists (select distinct name from table name=table.name where fenshu <=80)
以上那个对?或是2个都不对? 
最好比较一下错在那里。
----------------------------------------
你第一个根本不对,第二个是对的但是语法写错了!改为
select distinct name from [table] As A where not exists (select name from [table] where name=A.name And fenshu<=80)

热点排行