If I have table like this:
ID FROM_DATE TO_DATE
18177 2016-04-20 00:00 2016-04-20 00:00
18177 2016-04-20 00:00 2016-04-20 00:00
18177 2016-04-23 00:00 2016-04-23 00:00
18177 2016-04-23 00:00 2016-04-23 00:00
18177 2016-04-24 00:00 2016-04-24 00:00
18177 2016-04-24 00:00 2016-04-24 00:00
18177 2016-04-26 00:00 2016-04-26 00:00
18177 2016-04-26 00:00 2016-04-26 00:00
18177 2016-04-27 00:00 2016-04-27 00:00
18177 2016-04-27 00:00 2016-04-27 00:00
18177 2016-04-30 00:00 2016-04-30 00:00
18177 2016-04-30 00:00 2016-04-30 00:00
This table has no key, and I found my self need to set primary key composed of the three columns, but I can't do this because the data duplication.
How to delete the redundant data? For example, if I have two records with the same data, I want to keep only one record?
I want the result like this to fix the problem and set the key:
ID FROM_DATE TO_DATE
18177 2016-04-20 00:00 2016-04-20 00:00
18177 2016-04-23 00:00 2016-04-23 00:00
18177 2016-04-24 00:00 2016-04-24 00:00
18177 2016-04-26 00:00 2016-04-26 00:00
18177 2016-04-27 00:00 2016-04-27 00:00
18177 2016-04-30 00:00 2016-04-30 00:00