Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how can I compare 2 views?

Erhan_torontoJul 31 2013 — edited Aug 1 2013

I am using below to compare 2 indexes, but is there any way to compare two views in oracle to see the result like identical, not Exists or different by structure perspective ?

select decode

       (

            sum(decode(column_name_1, column_name_2, 0, 1))

          , 0

          , 'Identical'

          , null

          , 'Not exist'

          , 'Different'

       ) index_status

  from (

          select column_position

               , max(decode(index_owner, 'USER1' , column_name)) column_name_1

               , max(decode(index_owner, 'USER2', column_name)) column_name_2

            from all_ind_columns

           where table_name = 'TBL_A'

           group

              by column_position

       )

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 29 2013
Added on Jul 31 2013
19 comments
2,050 views