首页 > 代码库 > SQL集合操作符样例(UNION,INTERSECT,EXCEPT)

SQL集合操作符样例(UNION,INTERSECT,EXCEPT)

由于MYSQL目前只实现了UNION,

所以后面两个就没得玩罗。。。。

SELECT emp_id, assigned_branch_id    -> FROM employee    -> WHERE title = Teller    -> UNION    -> SELECT open_emp_id, open_branch_id    -> FROM account    -> WHERE product_cd = SAV    -> ORDER BY emp_id;

技术分享

SQL集合操作符样例(UNION,INTERSECT,EXCEPT)