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

时间:2021-10-11 19:50:14

由于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)