Mysql Help! UNIQUE vs INDEX difference.
Results 1 to 2 of 2

Thread: Mysql Help! UNIQUE vs INDEX difference.

  1. #1
    Senior Member Paul help!'s Avatar
    Join Date
    Aug 2013
    Location
    Manchester, England.
    Posts
    249

    Mysql Help! UNIQUE vs INDEX difference.

    Hi guys.

    I just have a simple question in regards to creating UNIQUE and INDEX columns in mysql.

    I understand what 'UNIQUE and INDEX' do and what their differences are,, but the only thing I am not sure of is whether 'INDEX' can be used for multiple columns like 'UNIQUE' can?

    Paul.

  2. #2
    High Energy Magic Dept. NogDog's Avatar
    Join Date
    Aug 2006
    Location
    Ankh-Morpork
    Posts
    14,842
    Yes. UNIQUE is really just a specific type of INDEX.

    Primary keys can also be across multiple columns -- they're basically a special case of a unique index.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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