MySQL Forums
Forum List  »  Newbie

table with multiple primary key
Posted by: Osmar Alvarez
Date: September 01, 2014 11:03PM

mysql> create table test (
-> id int auto_increment,
-> date date,
-> primary key (id,date) );
Query OK, 0 rows affected (0.00 sec)

Ok the above statement works, my question is when I try to do this:

mysql> alter table test add primary key (date);
ERROR 1068 (42000): Multiple primary key defined

Options: ReplyQuote

Written By
table with multiple primary key
September 01, 2014 11:03PM
September 02, 2014 12:27AM
September 02, 2014 07:14PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.