SQL> select * from a;
A
----------
1
2
3
SQL> select * from b;
B
----------
1
4
=========================UNION;列出所有,但重复项只列出一次=========================
SQL> select * from a union select * from b;
A
----------
1
2
3
4
=========================差集;列出不重复的项========================================
SQL> select * from a minus select * from b;
A
----------
2
3
=========================交集;列出重复的项========================================
SQL> select * from a intersect select * from b;
A
----------
1
========================全并集;列出所有的项======================================
SQL> select * from a union all select * from b;
A
----------
1
2
3
1
4
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14181270/viewspace-1059356/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/14181270/viewspace-1059356/