集合操作

Posted 夜月色下

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了集合操作相关的知识,希望对你有一定的参考价值。

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;

以上是关于集合操作的主要内容,如果未能解决你的问题,请参考以下文章

关于C++集合操作赋值和集合间操作的结果集合的疑问

关于C++集合操作赋值和集合间操作的结果集合的疑问

RedisRedis 集合 Set 操作 ( Set 集合数据 | 查询操作 | 查询所有值 | 随机获取值 | 获取交集并集差集 | 增操作 | 删操作 | 修改操作 )

Groovy集合遍历 ( 操作符重载 | 集合中的 “ + “ 操作符重载 | 集合中的 “ - “ 操作符重载 | 代码示例 )

Groovy集合遍历 ( 操作符重载 | 集合中的 “ + “ 操作符重载 | 集合中的 “ - “ 操作符重载 | 代码示例 )

Groovymap 集合 ( map 集合操作符重载 | *. 展开操作符 | 代码示例 )