At 20:41 -0400 4/7/04, Brad Tilley wrote:
Hello again,

How do you make a field unique, but not have it as part of the primary key?
For example, I have a 'computers' table that has a 'comp_id' field that's the
primary key. It's an int  that's auto-incremented with each new entry. The
same table has a 'comp_serial' field. I want this field to be unique, but I
don't want it to be a part of the primary key, or any key for that matter. I
just want it to be unique. How do I achieve this?

You are not limited to one unique index per table. Just create another index on the comp_serial column and make it UNIQUE.

--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

MySQL Users Conference: April 14-16, 2004
http://www.mysql.com/uc2004/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to