Oracle 多个查询结果的交集、差集和并集
union/union all运算:将查询的返回组合成一个结果, union
all不过滤重复。
SELECT product_id FROM order_items UNION SELECT product_id FROM inventories; SELECT location_id FROM locations UNION ALL SELECT location_id FROM departments;
intersect运算:返回查询结果中相同的部分。
SELECT product_id FROM inventories INTERSECT SELECT product_id FROM order_items;
SELECT product_id FROM inventories MINUS SELECT product_id FROM order_items;
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇: Apache 413 Request Entity Too Large
- 下一篇:没有了
