Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Comparing Two Columns from different tables and list out un-matched records.

Dear experts,

Please help me by providing the solution to the query: by comparing two columns of the same kind and listing out the unmatched records. The logic should read "common company" and "common order" from both tables, compare line numbers from both tables, and return unmatched line numbers as shown in the output table.

For Example: 

Table1:

 Company        Order           Line Number                                     

PBLG               319816              10
PBLG               319816              
PBLG               319816
DNKA              319734             10
DNKA              319734             20
DNKA              319734
DNKA              319734             40
PBLG               331606             20
PBLG               331606             30
PBLG               331606             40 
PBLG               331606             50

 

Table2:

Company        Order           Line Number

PBLG               319816              10
PBLG               319816              4
PBLG               319816              5
DNKA              319734             10
DNKA              319734             20
DNKA              319734             30
DNKA              319734             40
PBLG               331606             20
PBLG               331606             30
PBLG               331606            
PBLG               331606             

 

 

Output: 

ComapnyOrderResul Column
PBLG319816Missing Lines: 4,5
DNKA319734Missing Lines: 30
PBLG331606Missing Lines: 40,50

Thanks,

Sareen

6 Replies