cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
gandi2223
Level III

Add column from one table to another table

I have two data tables ("Table_A" and "Table_B"), both of which have a column "ID". They also both contain a column "Data_1", however with different values. In addition, Table_B has a column "Data_2".

11729_pastedImage_4.png11730_pastedImage_5.png

I would like to add Data_2 from Table_B to Table_A by matching the ID columns, however, Data_1 in Table_A should NOT be updated with the values of Data_1 in Table_B. This is the desired result:

11736_pastedImage_18.png

The only way I have found to achieve this is by using the Join command, by giving the particular output columns I require:

However, this creates a new table. I would prefer Data_2 from Table_B to simply be added to Table_A, without any further modifications to Table_A (which is why I cannot use Update). Is there a way to achieve this?

10 REPLIES 10
gandi2223
Level III

Re: Add column from one table to another table

Hi all,

thanks lots for your very helpful input.

I chose PMroz' method as 'correct answer' because I felt creating a subset using only the required columns was slightly more concise than duplicating the table first and then deleting columns, but obviously the other approaches work equally as well.

This solution does the trick for me. I am still surprised though that there is no option in the Update command to just add one particular column and leave everything else in the target table untouched. I initially thought the "Add Columns from Update table - Selected" option would do this, but clearly this is not the case.

Thanks again for all your replies, I really appreciate it!