SQL UNIQUE Constraint

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SQL UNIQUE Constraint

    Hello Friends,
    Actually i have a question about UNIQUE KEY Constraint in our SQL .
    I want to use more than one value as a UNIQUE KEY .

    Can I do this ?
    Sandeep DiL (INDIAN)




    #2
    look this table

    Code:
    CREATE TABLE `users` (
     `id` int(10) NOT NULL default '',
     `nick` varchar(20) NOT NULL default '',
     `pass` varchar(50) NOT NULL default '',
     `emailad` varchar(200) NOT NULL default '',
     `sitead` varchar(200) NOT NULL default '',
     PRIMARY KEY (`id`),
     UNIQUE KEY `nick` (`nick`)
    );

    In this table UNIQUE KRY is nick

    and i want to use nick as wel as emailad and sitead as an UNIQUE KEY

    Can anybody tell me that is this posibal or not?
    Sandeep DiL (INDIAN)



    Comment


      #3
      go to phpMyAdmin,
      -> table structure
      remove the unique nick,
      then select the nick and email row on the left side and click the unique icon at the bottom of the table structure.
      Advertise your mobile site for FREE with AdTwirl

      Comment

      Working...
      X