insert if not exist and delete old rows Hi to everyboby ;-)
i've a simple table with two (or three, according to what you think
about it :-) ) fields:
id | description | check
I periodically (say, every day, or every hour, or what you prefer) read
somewhere the information to store in this table.
Well, if the row is already present in the table (that is if a record
with the same id is already stored), i dont want to insert it again (in
order to save time, and resources, isnt it?).
Otherwise I'll insert as a new record.
Moreover, I'd want to insert a "check" field so that:
- if the record is already in the table I wont insert it again (but
i'll check that it's a good record),
- if the record is not in the table I'll insert it (and I'll check that
it's a good record), and
- at the end I want to delete old records, that is all the records that
I'v not checked.
Any idea about how to complete this task?
Thank you.
--
rob4you |