标签:
oracle的minus返回第一个表中有、第二个表中没有的数据
CREATE TABLE hovertree_union_1 ( id INT, val VARCHAR(10) ); CREATE TABLE hovertree_union_2 ( id INT, val VARCHAR(10) ); INSERT INTO hovertree_union_1 VALUES(1, ‘A‘); INSERT INTO hovertree_union_1 VALUES(2, ‘B‘); INSERT INTO hovertree_union_1 VALUES(3, ‘C‘); INSERT INTO hovertree_union_2 VALUES(1, ‘A‘); INSERT INTO hovertree_union_2 VALUES(1, ‘A‘); INSERT INTO hovertree_union_2 VALUES(2, ‘B‘); INSERT INTO hovertree_union_2 VALUES(4, ‘D‘); SQL> SELECT * FROM hovertree_union_1 2 MINUS 3 SELECT * FROM hovertree_union_2; ID VAL ---------- -------------------- 3 C SQL> SELECT * FROM hovertree_union_2 2 MINUS 3 SELECT * FROM hovertree_union_1; ID VAL ---------- -------------------- 4 D -- 何问起 hovertree.com
推荐:http://www.cnblogs.com/roucheng/p/3504463.html
oracle的minus返回第一个表中有、第二个表中没有的数据
标签:
原文地址:http://www.cnblogs.com/roucheng/p/minus.html