Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Merge Columns from two tables into same column in master table

 

I have two Tables:  Master and Mapping  as below:

 

Master    
 Company NameLocation 
 A Houston 
 B Dallas 
    
 D   
     
Mapping    
 Company NameLocation 
  Austin 
 D San Antonio 
     
Result    
Master     
 Company Name Location 
 A Houston 
 B Dallas 
  Austin 
 D San Antonio 
     

 

Using Query editor I wany to update Location column in table Master with Location in table Mapping where Company Name and Location exist in table Mapping.    Bear in mind there are hundreds of rows in my live tables.   These are just samples.

 

Is this possible in Query editor and how?

 

 

  • Hi Anonymous 

     

    In the query editor merge Master with Mapping on Location columns from both.

    After expanding add another column to coalesce between the two columns. The custom column will return the first non-null value so if you want Location from Mapping takes precedence, it should be the first column.

     

1 Reply

  • Hi Anonymous 

     

    In the query editor merge Master with Mapping on Location columns from both.

    After expanding add another column to coalesce between the two columns. The custom column will return the first non-null value so if you want Location from Mapping takes precedence, it should be the first column.