1-- NB: Applicable for Oracle and PL/SQL only
2
3select *
4from all_tab_cols A
5where
6 A.COLUMN_NAME in
7 (
8 select B.column_name
9 from all_tab_cols B
10 where B.table_name = 'YourFirstTable'
11 )
12 and A.table_name != 'YourFirstTable'
13 and A.TABLE_NAME = 'YourSecondTable';