Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql common columns

-- NB: Applicable for Oracle and PL/SQL only

select * 
from all_tab_cols A
where 
   A.COLUMN_NAME in 
   (
      select B.column_name
      from all_tab_cols B
      where B.table_name = 'YourFirstTable'
   )
   and A.table_name != 'YourFirstTable'
   and A.TABLE_NAME = 'YourSecondTable';
 
PREVIOUS NEXT
Tagged: #sql #common #columns
ADD COMMENT
Topic
Name
8+9 =