Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Index a 'duplicated' field ?

Status
Not open for further replies.

rab54

Programmer
Jan 28, 2004
112
GB
Hi gurus -

What is the best way to put a unique index on a column that already has duplicate data in ?

Should I remove the dupes first ? then add the index or is there a better way ....

Maybe dump the table ,remove dupes with DISTINCT and re-import ?

cheers

Rab
 
You must remove the duplicates first -- that is, after all, what a unique index is there to prevent.

How you remove the duplicates will depend on the structure of your table.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top