集合操作
发布日期:2021-08-12 02:36:15 浏览次数:5 分类:技术文章

本文共 919 字,大约阅读时间需要 3 分钟。

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;

转载于:https://www.cnblogs.com/shan2017/p/7294991.html

转载地址:https://blog.csdn.net/weixin_30642561/article/details/97258258 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:C#点击按钮关闭当前窗体 打开另一个窗体。
下一篇:SQL语句练习手册--第四篇

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年03月27日 15时55分53秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章