Re: The right query?

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Mon, 27 Jul 2009 11:13:28 -0300
Message-ID: <4a6db610$0$23759$9a566e8b_at_news.aliant.net>


Ralf Hackmann wrote:

> Hello,
>
> I have the following situation.
>
> I get an csv file from an other application daily and put it in an
> mysql DB, what is not a problem.
>
> the csv has the following fields f.e. (it has many more and other, but
> that is not relevant)
>
> F1;F2
> 1;T1
> 2;T2
> 3;T2
>
> In the mySQL DB I whant to put it in a table with additional fields,
> where users can add additional informations.
>
> F1;F2;A1;A2 (A1,A2 are the Field for the additional informations)
> 1;T1
> 2;T2
> 3;T3
>
> But at the next day it is possible, that the CSV-File from the other
> applikation has lines deleted and line added (which and how many lines
> are added and deleted I dont know before)
>
> How must I design my Tables and create my querys, that in the table
> with aditional Field the records are deleted and added, so that I dont
> have to compare each record of both tables in an programming language.
>
> Thanks
>
> Ralf

Use a separate staging table and use "not exists". Received on Mon Jul 27 2009 - 16:13:28 CEST

Original text of this message