Re: Comparing column names in two tables

From: Fraser <fraser_diane_at_hotmail.com>
Date: Tue, 19 Dec 2000 19:20:46 -0500
Message-ID: <3A3FFB5E.9C2D8E45_at_hotmail.com>


Thanks alot, works perfect.

Lee Miller wrote:

> Fraser <fraser_diane_at_hotmail.com> wrote:
> > Could someone help me with the sql command to compare the column names
> > in two Oracle tables. Specifically, I am trying to see which columns
> > are present in one table and not the other. Thanks in advance.
>
> (SELECT column_name FROM user_tab_columns WHERE table_name = 'table1' )
> MINUS
> (SELECT column_name FROM user_tab_columns WHERE table_name = 'table2' )
>
> will give columns in table1 but not in table2
Received on Wed Dec 20 2000 - 01:20:46 CET

Original text of this message