Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    47

    Unanswered: indexes, duplicate entries?

    I am trying to create an index for one of my databases but it keeps saying there are duplicated entries. How can I 'ignore' then and continue to create the index?

  2. #2
    Join Date
    Jul 2004
    Location
    Dundee, Scotland
    Posts
    107
    my understanding is that in MySQL an index field has to contain unique values. you should remove any duplicate keys before adding the index, or the following statement would create the index, ignore errors, deleting duplicate rows automatically!

    ALTER IGNORE TABLE table_name ADD UNIQUE INDEX(field_name);

    http://mysql.mirror.nedlinux.nl/doc/...ATE_INDEX.html

    if this is not appropriate, then you are looking have an index field with duplicate values. I don't know that answer.

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Don't insert duplicate records or don't make the index UNIQUE.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •