List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:July 26 1999 2:06pm
Subject:Re: deleting identical lines.
View as plain text  
On So, 1999-07-25 15:40:13 +0300, Mike Almogy wrote:
> how can i delete identical lines in MySQL ?
[...]
> I have a kerberos log file that i need to insert every 24 hours to the
> database, however i can't simply make a new log everyday.
> So (not optimal, but who says life is..) i will insert the log file
> every time from the start.
> I can do a drop database every update but i really don't want to.

Or you declare the relevant fields of your table as key fields, then
it will become impossible to insert duplicates.

In this case the solution maybe is not to delete identical rows, but
to use REPLACE INTO instead of INSERT INTO?  (For details see the
MySQL manual.)  Or see the REPLACE and IGNORE keywords with LOAD DATA
INFILE.  Whichever method you're using ...

Does this help?

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
deleting identical lines.Mike Almogy25 Jul
  • Re: deleting identical lines.Martin Ramsch26 Jul