union和distinct 的使用
来源:互联网 发布:avision扫描仪软件 编辑:程序博客网 时间:2024/06/05 10:23
insert into use_message(itemid,Category,staff_no,message,isSend) select '4875','Lib', c.staff_no ,'','1'from (select distinct b.staff_no from (select staff_no from employee where department in (select Department from (SELECT Department FROM xhs_Department WHERE Department in ('170','171','N1','E1','W1','S1','M1','H1') union SELECT Department FROM xhs_Department WHERE PDepartment_no IN (SELECT Department FROM xhs_Department WHERE Department in ('170','171','N1','E1','W1','S1','M1','H1') ) union SELECT Department FROM xhs_Department WHERE PDepartment_no IN (SELECT Department FROM xhs_Department WHERE PDepartment_no IN (SELECT Department FROM xhs_Department WHERE Department in ('170','171','N1','E1','W1','S1','M1','H1') ))) a)unionselect staff_no from employee where department in (select Department from (select Department from xhs_Department where Country in ('')) a)unionselect staff_no from employee where department in (select Department from (select Department from xhs_Department where Brand in ('')) a)) b) c
0 0
- union和distinct 的使用
- union和union all的使用
- mysql 集合操作UNION DISTINCT和UNION ALL
- HANA集合操作之UNION和UNION DISTINCT解析
- union和enum的使用
- oracle--nvl表达式和distinct的使用
- SQL 中 Count 和Distinct的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- MySQL中UNION和UNION ALL的使用
- Memcached 解析五
- ZOJ-2514
- CSS里面position:relative、absolute、static、relative总结
- Android Studio环境下关联Android源码
- 设计模式-行为型模式总结实例(二)
- union和distinct 的使用
- Hadoop简介
- 设计模式介绍之四:模板方法(Template Method)模式
- 基于颜色直方图的搜索
- C++标准库
- Spring3.0 详解
- webx—Session框架详解
- Leetcode: N-Queens
- CentOS6.5安装nginx1.5.8时出现“cp: "conf/koi-win" 与"/usr/local/nginx/conf/koi-win" 为同一文件”的解决方法