Results 1 to 5 of 5

Thread: Drop unique

  1. #1
    Join Date
    Nov 2003
    Location
    Sinapore
    Posts
    187

    Unanswered: Drop unique key

    Hi,

    I've a table with two unique keys on the same column. I've no idea how the second one came about. Here's is a partial output from show create table profiles:

    Code:
    Create Table: CREATE TABLE 'profiles' {
      ...
      UNIQUE KEY 'email' (email),
      UNIQUE KEY 'email_2' (email)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1
    How do I drop the second unique key?

    Thanks in anticipation
    Last edited by pearl2; 10-24-05 at 10:37.

  2. #2
    Join Date
    Apr 2005
    Location
    Baltimore, MD
    Posts
    297
    Code:
    ALTER TABLE `profiles` DROP INDEX `email_2`

  3. #3
    Join Date
    Nov 2003
    Location
    Sinapore
    Posts
    187
    Hi jfulton,

    Thanks I tried but it didn't work: ERROR 1064 (42000): You have an error in your SQL syntax; check....at line 1".

    Edited:

    Works without the single quotes around email_2

    Thanks
    Last edited by pearl2; 10-24-05 at 11:45.

  4. #4
    Join Date
    Mar 2004
    Posts
    480
    Those are not single quotes above, they are backticks (to the left of the 1 and exclamation key on your keyboard).

  5. #5
    Join Date
    Nov 2003
    Location
    Sinapore
    Posts
    187
    Ah, I see.

    Thanks, guelphdad

Posting Permissions

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