I have to combine data from three tables where more than one table has multiple rows into just one row and I have an instance where one relationship has no clear hiearchy. See example of the data below.
AccountNo | AccountInfo | AccountStatus | AccountType
1A XYZ Active 6
AccountNo | AccountCustomer | AccountRelationship
1A 123 Primary
1A 345 Secondary
1A 678 Secondary
AccountCustomer | AccountCustomerName
123 Mr. X
345 Ms. Y
678 Ms. X
I need to produce the table below from these 3 tables above.
1A 123 Mr. X 345 Ms. Y 678