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 <[EMAIL PROTECTED]> 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

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

Reply via email to