Is there a way to use pl sql dev to compare data in two tables

Jeff Kish

Member²
I have two tables.
They actually have pretty much the same columns.
Is there a way to use pl sql developer to compare the data in the tables by, say, keying on two columns?
 
No, this is currently not possible. You are not the first to ask though, so it's on the list of enhancement requests.
 
you can use "minus" to do this.

Code:
select cola, colb from tablea
minus
select cola, colb from tableb
to find combinations in a that do not exist in b and then the other way around as well to find combinations in b that do not exist in a.

Code:
select cola, colb from tableb
minus
select cola, colb from tablea
this is restricted to distinct values however.
 

Code:
select c1, c2, c3,
         count(src1) CNT1,
          count(src2) CNT2
     from
   ( select a.*,
          1 src1,
          to_number(null) src2
       from a
      union all
    select b.*,
         to_number(null) src1,
         2 src2
      from b
   )
  group by c1,c2,c3
 having count(src1) <> count(src2)
/
clever!
 
Back
Top