Hi,
another problem comes up. I want to "clean up" a table, in a way that there is no duplicate data in it. But I think it's more complicated than it sounds. At least to me.
Suppose I have the following table T1 whose contain is like this:
F1 F2 F3 F4 F5 F6
---------------------------------------------------
Row1: 2005-08-31 17:00:00 111 222 00 88
Row2: 2005-09-01 17:00:00 555 666 00 99
Row3: 2005-09-02 17:00:00 555 666 00 88
The key here is Fields F3, F4, F5. So is the logic:
when there are two or more rows that have the same F3 and F4 and F5, update this table with the newest date. When the combination of F3, F4, F5 is unique, the record stays.
So, the table above is supposed to look like this:
2005-08-31 17:00:00 111 222 00 88
2005-09-02 17:00:00 555 666 00 88
Row2 is deleted (not selected).
I've tried with several methods, but somehow I got stuck. Can it be done without creating an additional table? (Well, don't really care actually if several more tables have to be created). Can it be done at all?
Thanks guys for any clues!
another problem comes up. I want to "clean up" a table, in a way that there is no duplicate data in it. But I think it's more complicated than it sounds. At least to me.
Suppose I have the following table T1 whose contain is like this:
F1 F2 F3 F4 F5 F6
---------------------------------------------------
Row1: 2005-08-31 17:00:00 111 222 00 88
Row2: 2005-09-01 17:00:00 555 666 00 99
Row3: 2005-09-02 17:00:00 555 666 00 88
The key here is Fields F3, F4, F5. So is the logic:
when there are two or more rows that have the same F3 and F4 and F5, update this table with the newest date. When the combination of F3, F4, F5 is unique, the record stays.
So, the table above is supposed to look like this:
2005-08-31 17:00:00 111 222 00 88
2005-09-02 17:00:00 555 666 00 88
Row2 is deleted (not selected).
I've tried with several methods, but somehow I got stuck. Can it be done without creating an additional table? (Well, don't really care actually if several more tables have to be created). Can it be done at all?
Thanks guys for any clues!