Vivek Khera wrote:
> >>>>> "JT" == Jeff Thies <cyberjeff@stripped> writes:
> JT> I've got a table with duplicate entries, I'd like to alter the table
> JT> so that I have a unique index (and then use REPLACE INTO).
> JT> What happens to my rows that have the same value that are now in a
> JT> unique index???
> When you alter your table to have the unique index, it will complain
> and then refuse to generate said index. That is, you need to
> alter/delete those rows before the index will be created. That said,
> running the alter table command to add the index helps find those
alter table tablename IGNORE add UNIQUE indexname
will keep the first record for the index record created. The others will be
see section 7.7 of the manual.