Merging two or more versions of the same table

Creating tables and queries
Post Reply
klbeeuu
Posts: 1
Joined: Sat Nov 08, 2008 6:32 am

Merging two or more versions of the same table

Post by klbeeuu »

Three friends and I are working on populating a table. We have lots of missing information that we'll be filling in over time. Each of us will take a different section of the table (like I'll take entries 1-100, my friend will take 101-200, etc) and we'll work on filling in that data as it comes in.

Right now each of us has the same version of the database saved on our respective computers. But as one modifies her version on her own computer and another modifies her own version on her own computer, we'll have different versions of the same table saved on our respective computers. We want to be able to meet up once a week and merge all of the changes so that we all leave our weekly meeting with the most up-to-date version of the table that incorporates all of the work each person has done over the week.

Is there a way to do this?

Please keep in mind that I don't understand a lot of jargon. I've been reading the forums and see something about UNION SELECT but have no idea how to do that or if it would work in this case. I would need more or less a keystroke-by-keystroke explanation. I'm not stupid, but most of the responses in this forum are over my head.

Thanks.
OOo 2.4.X on Mac OSx other
QuazzieEvil
Volunteer
Posts: 283
Joined: Tue Dec 04, 2007 6:38 pm
Location: Houston, TX

Re: Merging two or more versions of the same table

Post by QuazzieEvil »

the least technical way i can think of is to select on master db for each session, and copy the tables you want synchronized (one at a time) into that db. then run the following SQL command to copy the rows from the tmp table to the [new] permanent table

Code: Select all

INSERT INTO PROPERTYTYPES SELECT *FROM PROPERTYTYPES2
alternatively you can do something like this, should you have auto-incrementing primary keys with conflicting values, you can limit the number of columns like this

Code: Select all

INSERT INTO  PROPERTYTYPES(NAME,DESCRIPTION) SELECT NAME,DESCRIPTION FROM PROPERTYTYPES2
In these examples, PROPERTYTYPES is the table that will have the combined data from all other dbs, and PROPERTYTYPES2 is the table copied from each of the other databases.

you can run this SQL command by going to Tools | SQL...

--hope this helps.
Post Reply