select COLUMN_NAME from ( SELECT t.COLUMN_NAME, COUNT(*) c FROM USER_TAB_COLUMNS t WHERE t.TABLE_NAME ='table1' OR t.TABLE_NAME='table2' GROUP BY COLU ...
select COLUMN_NAME from (
SELECT t.COLUMN_NAME, COUNT(*) c FROM USER_TAB_COLUMNS t WHERE t.TABLE_NAME ='table1'
OR t.TABLE_NAME='table2' GROUP BY COLUMN_NAME
)where c=2