[thelist] SQL: finding "new" records in a table

Fred Jones fredthejonester at gmail.com
Tue Sep 4 12:13:15 CDT 2007

>> I am no expert over here, but I would suggest that the only alternative 
>> is of course to compare the records, that is the CSV record versus your 
>> DB record, to see if an update is necessary or not.
> Agreed. My question then, is what is the most efficient way to do this? 
> I could load the csv file into a temp table and then find all the rows 
> that need inserts pretty easily via a join.
> What of the other rows though? What is the most efficient way to see if 
> two rows are identical for 12 columns?

I would compare them in your code. I would use SQL to get the rows from 
the DB, compare to the CSV data and then update if necessary.


More information about the thelist mailing list