![]() |
|
|
#1 |
|
Senior Member
Join Date: Jul 2004
Posts: 167
|
Question, how to update unqiue records on a cron?
I have a database that logs events and it's growing too big.
I'd like to set up a cron to reduce the records. Thet able looks like this eventid | date | eventname | error | type ================================== 1 | 1/1/01| exception | HD | 1 2 | 1/5/01| exception | HD | 1 3 | 1/5/01| shutdown | SD | 3 4 | 1/11/01| exception | HD | 2 5 | 1/12/01| exception | HD | 4 6 | 1/16/01| exception | ED | 2 ================================== If you look at the data above, the only data I care about keeping really is when the eventname and error are the same. So in this case, I'd like to roll up lines 1,2,4,5 into one line, with the eventid, date and type that should be kept is the last one. So it would be line 5 that is kept and lines 1,2,4 delete. How can I do that in mysql/php?
__________________
** Most misspellings intentional to combat spaham filterz** |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Erasing duplicate records automatically | nadsab | Navicat Support | 1 | 02-25-2005 08:41 AM |