top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

how to find common columns in two tables?

+3 votes
2,392 views
how to find common columns in two tables?
posted Feb 23, 2015 by Muskan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

Query For Find Same Column from each Table.

select A.COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS A
join INFORMATION_SCHEMA.COLUMNS B
on A.COLUMN_NAME = B.COLUMN_NAME
where A.TABLE_NAME = 'Table_1'
and B.TABLE_NAME = 'Table_2'

answer Feb 24, 2015 by Balamurugan Kn
...