I have a lot of csv files I load into a mysql database using 'LOAD DATA INFILE' that I want to update on a daily basis.
And I want to know:
- old records
- updated records
- new records
What I do is:
SET last_update = NOW() within the LOAD DATA INFILE SQL Using REPACE INTO statement so I know what is updated since the last time.
So I can make a difference between old and excisting updated records.
But I also want to know the new records from the last insert, so I thought I added:
"count_update=count_update+1" to the LOAD DATA INFILE statement, so new records are where count_update is 0 and the current datetime: last_update.
But "count_update=count_update+1" is not working using LOAD DATA FILE. How can I still make a difference between updated records and new records using this method?
Thanks in advance