Subscribe Bookmark RSS Feed

Joining tables without changing matching column name

lpaz

Community Trekker

Joined:

Jun 23, 2011

Is there a way to JOIN two tables by matching columns without ending up with 2 identical columns with different names?

Ex:

dt1 << Join With (dt2), by Matching Columns (:HH_ID = :HH_ID));

After I do this, HH_ID can no longer be found in the table, since it's now "HH_ID of dataset1".

Is there a way to keep just 1 column "HH_ID" in the resulting dataset?

Message was edited by: LPaz
3 REPLIES
mpb

Super User

Joined:

Jun 23, 2011

In the Join dialog you can check the option to Merge Same Name Columns. In the resulting joined table you can look at the embedded Source script to see how to script the same option.
Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

At the bottom of the Join dialog there's a check box for "Select columns for joined table". Use that and select only one of the matching columns.

Jeff
-Jeff
lpaz

Community Trekker

Joined:

Jun 23, 2011

Thanks! The "Merge Same Name Columns" option was exactly what I was looking for.