Link to home
Start Free TrialLog in
Avatar of SharonInGeorgia
SharonInGeorgia

asked on

ORACLE SLQ - Comparing records in 2 tables

Table 2 retrieves data from existing fields in Table 1.  The system also creates additional fields in Table 2.  Not all fields are transfered from Table 1 to Table 2.  These tables may have millions of records so efficentcy is important.

I need to compare that the records are accurately populated in Table2 from Table1.  

              TABLE 1                                      TABLE 2
           Field1                                               Field1
           Field2                                               Field2
           Field3                                               Field3
           Field4                                            
           Field5                    
                                                                  Field6
                                                                  Field7
ASKER CERTIFIED SOLUTION
Avatar of MikeOM_DBA
MikeOM_DBA
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of awking00
awking00
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SharonInGeorgia
SharonInGeorgia

ASKER

I understand that using UNION can be slow when dealing with massive amount of records.  What are your thoughts?
In this case, I would probably use UNION ALL instead of UNION, which should avoid an extra sort, although the results are the same.