##在Oracle中查询两张表中的不同字段
#使用系统表all_col_comments
#基本思路是,先查出相同字段,然后使用 not in
–查询两张表的不同字段名 oracle
select column_name
from all_col_comments
where table_name in (table_a,table_b)
and owner=owner_1
and column_name not in
(select a.column_name
from
(select * from all_col_comments t where t.table_name=table_a and owner=owner_1) a,
(select * from all_col_comments t where t.table_name=table_b and owner=owner_1) b
where a.column_name=b.column_name);