From: Date: October 20 2003 8:07pm Subject: Re: Newbie - Primary Keys List-Archive: http://lists.mysql.com/mysql/152017 Message-Id: <20031020180700.53250.qmail@web11701.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hi Carlos, You can't have 2 primary keys. A table can only have one primary key. You can, however, also define a Unique key, and if you set it up such that it is not null, it will act much like a prmary key: CREATE TABLE test ( id1 INT UNSIGNED NOT NULL, PRIMARY KEY (id1), id2 INT UNSIGNED NOT NULL, UNIQUE KEY (id2), data VARCHAR(25) ); Hope that helps, Mark --- Carlos Vazquez wrote: > Hi all! > > Just wanted to know how do I create a table with two > primary keys. > > Thanks a lot! > > __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com