怎样判断某员工表成绩列既有不及格,又有及格的?
时间:2011-11-16
来源:互联网
sql语句怎样查出符合条件的?
作者: anboat 发布时间: 2011-11-16
select * from 员工表 a where exists(select 1 from 员工表 where 员工ID=a.员工ID and 成绩='不及格') and exists(select 1 from 员工表 where 员工ID=a.员工ID and 成绩='及格')
作者: qianjin036a 发布时间: 2011-11-16
select sid from tb t where score >= 及格标准线 and exists (select 1 from tb where sid = t.sid and score < 及格标准线) group by sid
作者: AcHerat 发布时间: 2011-11-16
where m.id = n.id and m.grade >= 60 and m.grade < 60
作者: dawugui 发布时间: 2011-11-16
select distinct m.name from tb m , tb n
where m.id = n.id and m.grade >= 60 and m.grade < 60
select distinct m.name from tb m , tb n
where m.id = n.id and m.grade >= 60 and n.grade < 60
作者: dawugui 发布时间: 2011-11-16
if object_id('t3') is not null drop table t3 create table t3 (id int identity(1,1) primary key,name varchar(10),sc1 float ,sc2 float ,sc3 float) go insert t3 select 'A',10,20,30 union all select 'B',20,65,50 union all select 'C',60,80,90 go select * from t3 as a where not exists (select 1 from t3 where a.id=id and sc1<60 and sc2<60 and sc3<60) and not exists (select 1 from t3 where a.id=id and sc1>=60 and sc2>=60 and sc3>=60) /* (所影响的行数为 1 行) id name sc1 sc2 sc3 -- --- -- --- -- 2 B 20.0 65.0 50.0 */ go drop table t3
作者: xiaolinyouni 发布时间: 2011-11-16
作者: anboat 发布时间: 2011-11-16
例如:case Staff_Status when '全职' then '临时-全职' else '全职-临时' end;
Staff_Status这个中状态时这个月的最后一天的状态
作者: anboat 发布时间: 2011-11-16
得到问题的回答后,请及时结帖.
作者: qianjin036a 发布时间: 2011-11-16
楼主的结帖率为0.00%
得到问题的回答后,请及时结帖.
尊重别人的劳动
作者: jiemo587 发布时间: 2011-11-16
作者: anboat 发布时间: 2011-11-16
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28