question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to join two tables with identical column names

See original GitHub issue

We would like to join tables. Right now we are using:

table = table.joinOn( joinByColumns ).leftOuter( additionalTable  );

Challenges:

  • additionalTable has columns that exist already in table.
  • additionalTable may have missing rows.

We would like to have it such that values in additionalTable should replace the values in table in columns with duplicate names.

Is there an implementation for this?

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
lwhite1commented, Nov 9, 2022

there is a replace method

On Wed, Nov 9, 2022 at 12:14 PM Christian Tischer @.***> wrote:

I don’t understand why you want to “keep” the right side columns but replace them with the values from the left side.

We need it want it the other way around: replace the columns on the left with the columns on the right.

If it were me I would try to write something that found all the duplicate names and did a column replace

That sounds good! Is there something to directly replace a column, or would I need to do a column removal followed by an addition?

— Reply to this email directly, view it on GitHub https://github.com/jtablesaw/tablesaw/issues/1168#issuecomment-1309079467, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2FPAXL7MQ53LSLK5P5TKDWHPLW5ANCNFSM6AAAAAAR3P236E . You are receiving this because you commented.Message ID: @.***>

0reactions
tischicommented, Nov 10, 2022

Thanks a lot for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Querying the inner join of two tables with the same column ...
You need to qualify your column names with the table names. SELECT table1.name1, table2.name1, etc. ... Its true you have to separate the...
Read more >
How to Use Column-Name Join and Inner Join in SQL
In a natural join, all the source table columns that have the same name are compared with each other for equality. With the...
Read more >
SQL INNER JOIN | Intermediate SQL - Mode Analytics
When you join two tables, it might be the case that both tables have columns with identical names. In the below example, both...
Read more >
How to Join Two Tables by Multiple Columns in SQL
Example 1: SQL JOIN by Two Columns ... ON s.teacher_first_name = t.first_name AND s.teacher_last_name = t.last_name;. If you need a refresher on ...
Read more >
Combining two tables with identical column names - YouTube
We stack together two data tables (one with 3 rows, the other with 2 rows) to create one larger data table with 5...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found