I was recently tasked with merging multiple "databases" that contain mailing information. They are actually excel sheets with slightly different layouts, but I imported them into SQL because I thought it was a clever solution to my problem. Turns out I was wrong.
Here is a basic overview of the data each excel file contains. Each excel file contains mailing information such as First Name, Last Name, Address, etc. The important part of each file is the mailing "Code," this code represents what group the person belongs to.
There are many people who appear in multiple files, and so they have multiple codes. Because of this, I need each person to appear with all relevant codes in the same row. So what I did initially is to import each file into its own SQL table, and then I did a number of full joins on each table for First Name AND Last Name. Like this:
FULL JOIN dbo.LIST2
ON LIST1$.FName = LIST2.FName AND LIST1$.LName = LIST2.LName
FULL JOIN dbo.LIST3
ON LIST2.FName = LIST3.FName AND LIST2.LName = LIST3.LName
And then this continues on for about 5 more tables.
This gives me the structure I want, but some people who show codes from LIST1 and LIST2 in the same row, but then they appear again in another row with LIST3 as the code, even though the LName and FName matches that in LIST1 and LIST2. There is also a massive section of NULL rows near the end.
Perhaps doing it through SQL is the wrong way, and I'm open to any suggestions, I just need to get these joined and organized. Any help is appreciated! Thank you!