oracle - Getting common fields of two tables in PL/SQL -


suppose table , table b have various fields. easy way common fields among table , table b ? want inner join on these tables don't know common fields are.

note in pl/sql. when table a. or b. list of fields names of each table in drop down menu. common fields.

it depends on mean "common fields".

if want colums names same in both tables, can use query:

select t1.column_name user_tab_columns t1 join user_tab_columns t2 on t1.column_name = t2.column_name /*     , t1.data_type = t2.data_type    , t1.data_length = t2.data_length */ t1.table_name = 'a'   , t2.table_name = 'b'   ; 

demo: http://sqlfiddle.com/#!4/2b662/1

but if @ tables in above demo, see table a has column named x datatype varchar2, , table b has column named x of different type int.

if want columns have the same names, same datatypes , same length, uncomment respective conditions in above query.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -