找忘记填写性别的员工
来源:互联网 发布:微信查删除好友软件 编辑:程序博客网 时间:2024/05/17 02:58
已知:
Table: (员工 emp1)
id name
1 a
2 b
3 c
4 d
Table:( 性别 sext)
id sex
1 男
4 女
5 男
找出忘记填写性别的员工(用Oracle的两种方式)
Create Table Empl( Id Number(4) primary key, name varchar2(10));Insert Into Empl Values (1,'a') ;Insert Into Empl Values (2,'b') ;Insert Into Empl Values (3,'c') ;Insert Into Empl Values (4,'d') ;Insert Into Empl Values (5,'e') ;Select * From Empl;/*-----------------------------------------------*/Create Table sext( Id Number(4) Primary Key, sex varchar2(10));Insert Into Sext Values(1,'男');Insert Into Sext Values(3,'女');Insert Into Sext Values(5,'男');Select * From Sext;/*----- 找出忘记填写性别的员工(用Oracle的两种方式) -------------*/Select Id,Name From Empl E Where E.Id Not In(Select Id From Sext); --minus差集Select Id From Empl Minus Select Id From Sext; -- <>Select * From Empl Where Id <> All(Select Id From Sext); -- 先求id的差集Select E.* From Empl E,(Select Id From Empl Minus Select Id From Sext) S /*临时表s*/Where E.Id = S.Id; --左外莲接1Select E.Id,E.Name From Empl E,Sext S Where E.Id=S.Id(+) And S.Sex Is Null; --左外莲接2Select * From EmplLeft Outer Join Sext On Empl.Id = Sext.Id Where Sext.Sex Is Null; --not existsSelect * From Empl E Where Not Exists (Select * From Sext S Where E.Id = S.Id); --not inSelect * From Empl Where Id Not In (Select Empl.Id From Empl, Sext Where Empl.Id = Sext.Id);--Intersect相交Select Name From Empl Where Id Not In (Select Id From Empl Intersect Select Id From Sext);--此种先求两个表id的合集。当count(*)=2表示id重复,<2时表示未填写Select * From Empl E Where (Select Count(*) From (Select Id From Empl Union All Select Id From Sext) TWhere T.Id=E.Id)<2;
- 找忘记填写性别的员工
- Extjs案例--员工信息填写界面布局
- svn忘记密码不用找管理员最直接的办法
- 忘记在哪儿找的了,Excel中的图片抽取
- 注册和忘记密码模块fieldset的显示和下一步按钮需要在填写完成以后运行
- 现金支票的填写
- 规范的填写版本号
- 中文问题的一些建议,转载,那里找的,忘记了
- [英语阅读]上班族调查:老板性别影响员工压力程度
- 一波未平一波又起,前员工起诉Magic Leap性别歧视
- 填写
- 忘记该忘记的
- 忘记该忘记的
- js实现弹出窗口代码集萃 (怕忘记找别人的)
- 查询emp表入职时间(jointime)为2012-8到2012-9所有在职(zaizhi=1 )的员工,按照部门(deptno)、性别(sex)统计人数
- 常见的数据填写错误
- h264 RTP头的填写
- 填写职业时的反思
- MFC 模态对话框的实现原理
- hibernate 多表查询
- ZOJ1414
- oracle,job停了
- hdu(1045)Fire Net(深搜+回朔)
- 找忘记填写性别的员工
- FOJ1559
- Eclipse调试Java的10个技巧
- C++访问MySql数据库
- 两年了——青春!
- c++:eclipse 开发c++环境配置(保你编译成功)
- Spring MVC 教程,快速入门,深入分析
- Web Application Vulnerability Scanners – W3AF – 12.10 xUbuntu Installation
- Zend Guard 5.5.0使用教程