I am sure , that many people before me faced a need to merge nearly- duplicate rows from several databases. However, I have not been able to find a simple yet general solution. I provided a data sample in Excel here: https://disk.yandex.ru/d/UtuENQ4LXHmOmQ It shows in yellow the 4 rows, that I have now, and one row in green, that I want to make. The new row should have some data only from one of the 4 database in some columns, and merged from all (or some) databases in other columns. I will delete the original rows after the merger. I spent all morning trying to figure out what functions to use. I have INSERT INTO, VALUES, WHERE , but smth else is missing. Could someone please direct me to a possible solution?

  • Welcome to the DBA.SE community. Please consider adding additional information to your question instead of in a comment. Comments are not regarded as part of the question and can be deleted by moderation. Hit the edit button and add as much information as possible. Please also consider having a look at minimal reproducible example and How to Ask to get an idea of how to ask a great question. Thanks.
    – John K. N.
    Commented Jan 24, 2022 at 15:59

1 Answer 1


There is no intrinsic order to the rows in a Relational database table.
Given this, how do you intend to identify "Row 1" and "Row 2"?

If your data already exists in "Row 1" and "Row 2", why do you want to duplicate that data (into "Row 3")?
Duplication of data is generally a Bad Idea.

Show us the structure of your table(s) and enough sample data to better understand your scenario. That way, we might be able to offer you better advice. Right now, we're basically guessing.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.