码迷,mamicode.com
首页 > 其他好文 > 详细

集合操作

时间:2017-08-06 17:02:56      阅读:111      评论:0      收藏:0      [点我收藏+]

标签:span   union   justify   mil   family   char   select   集合   order   

select employee_id, job_id from employees

union all

select employee_id, job_id from job_history;

 

select employee_id, job_id from employees

union

select employee_id, job_id from job_history;   没有重复值 触发排序

 

select employee_id, job_id from employees

intersect

select employee_id, job_id from job_history;

 

select employee_id from employees

minus

select employee_id from job_history;

 

select employee_id, job_id, salary from employees

union all

select employee_id, job_id, null from job_history;

 

select employee_id, job_id, to_char(salary) from employees

union all

select employee_id, job_id, ‘no salary‘ from job_history;

 

集合排序:

select employee_id, job_id, salary from employees

union all

select employee_id, job_id, null from job_history

order by salary;

 

select employee_id, job_id, null from job_history

union all

select employee_id, job_id, salary from employees

order by 3;

集合操作

标签:span   union   justify   mil   family   char   select   集合   order   

原文地址:http://www.cnblogs.com/shan2017/p/7294991.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!