[mythtv-users] Possibly OT: Merging Tables, NO duplicates.

Brad DerManouelian myth at dermanouelian.com
Mon Nov 10 22:39:10 UTC 2008


On Nov 10, 2008, at 2:30 PM, R. G. Newbury wrote:

>  I am having a problem which I am sure has been addressed by someone
> before now, and I don't wish to waste time re-inventing the wheel,
>
> I have a small (presently command-line controlled) sqlite program to
> keep track of time usage. It runs on 3 different physical computers. I
> need to merge the entries, *without duplication*. All three units run
> the same app and the tables are the same. But I want the entries I  
> make
> on the laptop and/or the Nokia tablet to end up merged into the  
> 'master'
> on the desktop.
> ...snip...
> Is this the way to do it, or am I missing something really easy,  
> such as
> a horribly complex 'select....join' statement. Note that the schema of
> all of these tables is exactly the same.
>
> (And the answer to this has some relevance to updating/merging  
> different
> instances of mythtv tables....such as moving a mythfilldatabase update
> from one machine to another without replacing the entire table.)

Take a look at REPLACE INTO to see if that helps you. It basically  
acts as an INSERT unless it finds a duplicate primary key and them  
simply updates that row with the new values.


More information about the mythtv-users mailing list