Forum Discussion

gwright15's avatar
gwright15
Helper I
7 years ago

Merge Duplicating records

Good afternoon

 

I have two tables i need to merge.  Both tables have a common field of an order number.  The first time contains all order changes which have occurred, and as such, the order number will appear multi times.  The second table contain additional information on each order - the order number only appears once in this second time - i.e. no duplicates.

 

When i merge the tables i get a 100% match on rows from the first table using a left outer join.  However, some data is being duplicated.

 

When i filter the first table for one of the orders which is being duplicated, for example order 99999, and then merge the data, no duplicates occur.  

 

I can't understand why the data is being duplicated - please help.

2 Replies

  • So, typically, as soon as i type this, i tried something new.

     

    The original table 1 was created via the wizard.  I replaced with this some SQL code instead, and it seems to have fixed the issue.  No idea why?

    • v-lili6-msft's avatar
      v-lili6-msft
      Community Support

      HI, gwright15 

      If there is something wrong when you do merge in Edit Queries?

      Could you share some sample data and your expected output with your M code for us have a test?

       

      Best Regards,

      Lin