1. 4种操作符:union,union all,intersect,minus
2. SELECT...
UNION
(SELECT...
INTERSECT
SELECT...)
INTERSECT
SELECT...
Just be sure to use the parentheses so that:
n The code enclosed is a standalone query and does not include an ORDER BY
clause.
n The enclosed code is placed into the outer query as though it were a single,
standalone SELECT statement, without the ORDER BY clause.
n If an ORDER BY is desired, it must be the final clause in the entire series of
statements.
UNION
(SELECT...
INTERSECT
SELECT...)
INTERSECT
SELECT...
Just be sure to use the parentheses so that:
n The code enclosed is a standalone query and does not include an ORDER BY
clause.
n The enclosed code is placed into the outer query as though it were a single,
standalone SELECT statement, without the ORDER BY clause.
n If an ORDER BY is desired, it must be the final clause in the entire series of
statements.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22327710/viewspace-764146/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22327710/viewspace-764146/