I have two tables, one sales invoice header and one sales credit memos, that I would like to combine into one. However, the same document number can exist in both tables meaning I will have "false" duplicates in my merged table. How would you suggest to handle this?
Looking at the description you have your Sales invoice header should have a unique ID that links to the sales credit memos, you must check if it makes more sense to use the left join, right join or full join while merging the two tables, also the order that you use your tables to merge is important.
But without any specific examples is hard to give you an answer please see this post regarding How to Get Your Question Answered Quickly:
I have attached some example data - one tab for Sales Inv Header and one tab for Sales Cr Header. Since the two document types were using two different number series that were so much alike they "collided" in the end.
What I would like to do is to merge these two tables into one table where invoice 101010 should be one entry and credit memo 101010 should be another line. One idea I have is to put a prefix in front of the document number, i.e. INV101010 and CR101010, but that means I won't be able to use document number in another relationsships.